Verified Collision Checks and Rendering

This commit is contained in:
Steffen Illium
2023-11-23 11:43:04 +01:00
parent 142bbb2c0c
commit 2f29ef703c
6 changed files with 14 additions and 6 deletions

View File

@@ -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):