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
17
agent.py
17
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':
|
||||||
@ -145,7 +138,15 @@ class Agent:
|
|||||||
self.turn_right()
|
self.turn_right()
|
||||||
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