Poprawka, przesunięcie momentu wykonania operacji załadunku/rozładunku, tak aby wózek wcześniej obrócił się we właściwym kierunku
This commit is contained in:
parent
98c16b9227
commit
06ce652016
15
agent.py
15
agent.py
@ -117,13 +117,6 @@ class Agent:
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
next = self.path.pop()
|
next = self.path.pop()
|
||||||
if (next.x, next.y) == dest_coords:
|
|
||||||
if self.dest.package:
|
|
||||||
self.pick_up_package(self.dest.package)
|
|
||||||
return
|
|
||||||
elif self.dest.is_rack:
|
|
||||||
self.unload_package(self.dest)
|
|
||||||
return
|
|
||||||
star_dir = self.direction
|
star_dir = self.direction
|
||||||
if self.x > next.x and not self.direction == 'left':
|
if self.x > next.x and not self.direction == 'left':
|
||||||
if self.direction == 'down':
|
if self.direction == 'down':
|
||||||
@ -146,6 +139,14 @@ class Agent:
|
|||||||
else:
|
else:
|
||||||
self.turn_left()
|
self.turn_left()
|
||||||
|
|
||||||
|
if (next.x, next.y) == dest_coords:
|
||||||
|
if self.dest.package:
|
||||||
|
self.pick_up_package(self.dest.package)
|
||||||
|
return
|
||||||
|
elif self.dest.is_rack:
|
||||||
|
self.unload_package(self.dest)
|
||||||
|
return
|
||||||
|
|
||||||
if star_dir == self.direction:
|
if star_dir == self.direction:
|
||||||
self.x = next.x
|
self.x = next.x
|
||||||
self.y = next.y
|
self.y = next.y
|
||||||
|
Loading…
Reference in New Issue
Block a user