mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-06-18 18:52:52 +02:00
updated base factory
This commit is contained in:
@ -74,10 +74,10 @@ class BaseFactory:
|
|||||||
|
|
||||||
def move_or_colide(self, agent_i, action) -> ((int, int), bool):
|
def move_or_colide(self, agent_i, action) -> ((int, int), bool):
|
||||||
old_pos, new_pos, valid = h.check_agent_move(state=self.state,
|
old_pos, new_pos, valid = h.check_agent_move(state=self.state,
|
||||||
dim=agent_i + h.AGENT_START_IDX,
|
dim=agent_i + h.AGENT_START_IDX,
|
||||||
action=action)
|
action=action)
|
||||||
if valid:
|
if valid:
|
||||||
# Does not collide width level boundrys
|
# Does not collide width level boundaries
|
||||||
self.move(agent_i, old_pos, new_pos)
|
self.move(agent_i, old_pos, new_pos)
|
||||||
return new_pos, valid
|
return new_pos, valid
|
||||||
return old_pos, valid
|
return old_pos, valid
|
||||||
|
Reference in New Issue
Block a user