mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-06-24 04:11:36 +02:00
small adjustments and "DestinationReachAny" as replacement for "DestinationDone"
This commit is contained in:
@ -63,7 +63,7 @@ Rules:
|
|||||||
Collision:
|
Collision:
|
||||||
done_at_collisions: false
|
done_at_collisions: false
|
||||||
AssignGlobalPositions: {}
|
AssignGlobalPositions: {}
|
||||||
DestinationDone: {}
|
DestinationReachAny: {}
|
||||||
DestinationReach:
|
DestinationReach:
|
||||||
n_dests: 1
|
n_dests: 1
|
||||||
DestinationSpawn:
|
DestinationSpawn:
|
||||||
|
@ -59,7 +59,7 @@ class SpawnAgents(Rule):
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
pos = positions.pop()
|
pos = positions.pop()
|
||||||
except IndexError as e:
|
except IndexError:
|
||||||
raise ValueError(f'It was not possible to spawn an Agent on the available position: '
|
raise ValueError(f'It was not possible to spawn an Agent on the available position: '
|
||||||
f'\n{agent_name[agent_name]["positions"].copy()}')
|
f'\n{agent_name[agent_name]["positions"].copy()}')
|
||||||
if agents.by_pos(pos) and state.check_pos_validity(pos):
|
if agents.by_pos(pos) and state.check_pos_validity(pos):
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
# Destination Env
|
# Destination Env
|
||||||
DESTINATION = 'Destinations'
|
DESTINATION = 'Destinations'
|
||||||
DEST_SYMBOL = 1
|
DEST_SYMBOL = 1
|
||||||
|
|
||||||
WAIT_ON_DEST = 'WAIT'
|
WAIT_ON_DEST = 'WAIT'
|
||||||
|
|
||||||
MODE_SINGLE = 'SINGLE'
|
MODE_SINGLE = 'SINGLE'
|
||||||
MODE_GROUPED = 'GROUPED'
|
MODE_GROUPED = 'GROUPED'
|
||||||
|
@ -17,7 +17,7 @@ class DoorAutoClose(Rule):
|
|||||||
doors_that_ticked = [key for key, val in doors_tick_result.items() if val]
|
doors_that_ticked = [key for key, val in doors_tick_result.items() if val]
|
||||||
state.print(f'{doors_that_ticked} were auto-closed'
|
state.print(f'{doors_that_ticked} were auto-closed'
|
||||||
if doors_that_ticked else 'No Doors were auto-closed')
|
if doors_that_ticked else 'No Doors were auto-closed')
|
||||||
return [TickResult(self.name, validity=c.VALID, value=0)]
|
return [TickResult(self.name, validity=c.VALID, value=1)]
|
||||||
state.print('There are no doors, but you loaded the corresponding Module')
|
state.print('There are no doors, but you loaded the corresponding Module')
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -17,4 +17,3 @@ def init():
|
|||||||
shutil.copytree(template_path, cwd)
|
shutil.copytree(template_path, cwd)
|
||||||
print(f'Templates copied to {cwd}"/"{template_path.name}')
|
print(f'Templates copied to {cwd}"/"{template_path.name}')
|
||||||
print(':wave:')
|
print(':wave:')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user