Only deliver reasonable clients
This commit is contained in:
parent
1c5f23d624
commit
f31e6e74c8
11
reborn.py
11
reborn.py
|
@ -272,11 +272,12 @@ try:
|
||||||
for c in Client.near(Warehouse.get(0).pos):
|
for c in Client.near(Warehouse.get(0).pos):
|
||||||
if d < Drone.len():
|
if d < Drone.len():
|
||||||
pack = c.pack()
|
pack = c.pack()
|
||||||
for i in pack:
|
if len(pack) == len(c.needs):
|
||||||
Drone.get(d).addTask('load', Warehouse.get(0), Product.get(i), 1)
|
for i in pack:
|
||||||
for i in pack:
|
Drone.get(d).addTask('load', Warehouse.get(0), Product.get(i), 1)
|
||||||
Drone.get(d).addTask('deliver', c, Product.get(i), 1)
|
for i in pack:
|
||||||
d += 1
|
Drone.get(d).addTask('deliver', c, Product.get(i), 1)
|
||||||
|
d += 1
|
||||||
while turn < SIMULATION:
|
while turn < SIMULATION:
|
||||||
newTurn()
|
newTurn()
|
||||||
|
|
||||||
|
|
Reference in a new issue