Debugging and collision rendering
This commit is contained in:
@ -494,10 +494,10 @@ class BaseFactory(gym.Env):
|
||||
if self._actions.is_moving_action(agent.temp_action):
|
||||
if agent.temp_valid:
|
||||
# info_dict.update(movement=1)
|
||||
reward -= 0.001
|
||||
reward -= 0.01
|
||||
pass
|
||||
else:
|
||||
reward -= 0.01
|
||||
reward -= 0.05
|
||||
self.print(f'{agent.name} just hit the wall at {agent.pos}.')
|
||||
per_agent_info_dict[agent.name].update({f'{agent.name}_vs_LEVEL': 1})
|
||||
|
||||
|
@ -65,7 +65,7 @@ class DirtRegister(MovingEntityObjectRegister):
|
||||
def as_array(self):
|
||||
if self._array is not None:
|
||||
self._array[:] = c.FREE_CELL.value
|
||||
for dirt in self.values():
|
||||
for dirt in list(self.values()):
|
||||
if dirt.amount == 0:
|
||||
self.delete_item(dirt)
|
||||
self._array[0, dirt.x, dirt.y] = dirt.amount
|
||||
|
@ -136,7 +136,7 @@ def asset_str(agent):
|
||||
# if any([x is None for x in [self._slices[j] for j in agent.collisions]]):
|
||||
# print('error')
|
||||
col_names = [x.name for x in agent.temp_collisions]
|
||||
if c.AGENT.value in col_names:
|
||||
if any(c.AGENT.value in name for name in col_names):
|
||||
return 'agent_collision', 'blank'
|
||||
elif not agent.temp_valid or c.LEVEL.name in col_names or c.AGENT.name in col_names:
|
||||
return c.AGENT.value, 'invalid'
|
||||
|
Reference in New Issue
Block a user