mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-05-23 07:16:44 +02:00
added viz. of agent collision
This commit is contained in:
parent
30af16190e
commit
ee87ea3bef
BIN
environments/factory/assets/agents/agent_collision.png
Normal file
BIN
environments/factory/assets/agents/agent_collision.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
@ -45,9 +45,9 @@ class GettingDirty(BaseFactory):
|
|||||||
|
|
||||||
def asset_str(agent):
|
def asset_str(agent):
|
||||||
cols = ' '.join([self.slice_strings[j] for j in agent.collisions])
|
cols = ' '.join([self.slice_strings[j] for j in agent.collisions])
|
||||||
asset_str = f'agent{agent.i + 1}violation' if (not agent.action_valid or 'level' in cols or 'agent' in cols) \
|
if 'agent' in cols: return 'agent_collision'
|
||||||
|
return f'agent{agent.i + 1}violation' if (not agent.action_valid or 'level' in cols or 'agent' in cols) \
|
||||||
else (f'agent{agent.i + 1}valid' if self._is_clean_up_action(agent.action) else f'agent{agent.i + 1}')
|
else (f'agent{agent.i + 1}valid' if self._is_clean_up_action(agent.action) else f'agent{agent.i + 1}')
|
||||||
return asset_str
|
|
||||||
|
|
||||||
agents = {f'agent{i+1}': [Entity(asset_str(agent), agent.pos)]
|
agents = {f'agent{i+1}': [Entity(asset_str(agent), agent.pos)]
|
||||||
for i, agent in enumerate(self.agent_states)}
|
for i, agent in enumerate(self.agent_states)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user