(Unit unit)
| 17 | } |
| 18 | |
| 19 | public static void placeUnit(Unit unit) { |
| 20 | for (Map.Entry<Location, Unit> entry: locationMap.entrySet()){ |
| 21 | // if (SimpleStrategy.works()) |
| 22 | //get lock on entry.getKey() |
| 23 | if(entry.getValue()==null){ |
| 24 | unit.locationId = entry.getKey().id; |
| 25 | } |
| 26 | //release lock |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | public static void removeUnit(Product product) { |
| 31 | for (Map.Entry<Location, Unit> entry: locationMap.entrySet()){ |