updated base factory

This commit is contained in:
romue
2021-05-11 17:45:27 +02:00
parent c539e5dddd
commit 65cf5c5c6f

View File

@ -63,9 +63,7 @@ class BaseFactory:
pos_x, pos_y = pos pos_x, pos_y = pos
collisions_vec = self.state[:, pos_x, pos_y].copy() # "vertical fiber" at position of agent i collisions_vec = self.state[:, pos_x, pos_y].copy() # "vertical fiber" at position of agent i
collisions_vec[h.AGENT_START_IDX + agent_i] = h.IS_FREE_CELL # no self-collisions collisions_vec[h.AGENT_START_IDX + agent_i] = h.IS_FREE_CELL # no self-collisions
if valid: if not valid:
pass
else:
collisions_vec[h.LEVEL_IDX] = h.IS_OCCUPIED_CELL collisions_vec[h.LEVEL_IDX] = h.IS_OCCUPIED_CELL
return collisions_vec return collisions_vec
@ -82,9 +80,7 @@ class BaseFactory:
# Does not collide width level boundrys # Does not collide width level boundrys
self.move(agent_i, old_pos, new_pos) self.move(agent_i, old_pos, new_pos)
return new_pos, valid return new_pos, valid
else: return old_pos, valid
# Agent seems to be trying to collide in this step
return old_pos, valid
@property @property
def free_cells(self) -> np.ndarray: def free_cells(self) -> np.ndarray: