mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-12-06 15:40:37 +01:00
Verified Collision Checks and Rendering
This commit is contained in:
@@ -198,14 +198,14 @@ class WatchCollisions(Rule):
|
||||
|
||||
def tick_post_step(self, state) -> List[TickResult]:
|
||||
self.curr_done = False
|
||||
pos_with_collisions = state.get_collision_positions()
|
||||
results = list()
|
||||
for agent in state[c.AGENT]:
|
||||
a_s = agent.state
|
||||
if h.is_move(a_s.identifier) and a_s.action_introduced_collision:
|
||||
results.append(TickResult(entity=agent, identifier=c.COLLISION,
|
||||
reward=self.reward, validity=c.VALID))
|
||||
for pos in pos_with_collisions:
|
||||
|
||||
for pos in state.get_collision_positions():
|
||||
guests = [x for x in state.entities.pos_dict[pos] if x.var_can_collide]
|
||||
if len(guests) >= 2:
|
||||
for i, guest in enumerate(guests):
|
||||
|
||||
Reference in New Issue
Block a user