mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-07-05 09:01:36 +02:00
added simple_crossing scenario
This commit is contained in:
70
marl_factory_grid/configs/simple_crossing.yaml
Normal file
70
marl_factory_grid/configs/simple_crossing.yaml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
General:
|
||||||
|
# Your Seed
|
||||||
|
env_seed: 69
|
||||||
|
# Individual vs global rewards
|
||||||
|
individual_rewards: true
|
||||||
|
level_name: simple_crossing
|
||||||
|
# View Radius; 0 = full observatbility
|
||||||
|
pomdp_r: 0
|
||||||
|
verbose: true
|
||||||
|
tests: false
|
||||||
|
|
||||||
|
Agents:
|
||||||
|
Agent_horizontal:
|
||||||
|
Actions:
|
||||||
|
- Noop
|
||||||
|
- Move8
|
||||||
|
Observations:
|
||||||
|
- Walls
|
||||||
|
- Other
|
||||||
|
- Destination
|
||||||
|
# Avaiable Spawn Positions as list
|
||||||
|
Positions:
|
||||||
|
- (1,2)
|
||||||
|
# It is okay to collide with other agents, so that
|
||||||
|
# they end up on the same position
|
||||||
|
is_blocking_pos: true
|
||||||
|
Agent_vertical:
|
||||||
|
Actions:
|
||||||
|
- Noop
|
||||||
|
- Move8
|
||||||
|
Observations:
|
||||||
|
- Walls
|
||||||
|
- Other
|
||||||
|
- Destination
|
||||||
|
Positions:
|
||||||
|
- (2,1)
|
||||||
|
is_blocking_pos: true
|
||||||
|
|
||||||
|
# Other noteworthy Entitites
|
||||||
|
Entities:
|
||||||
|
Destinations:
|
||||||
|
# Let them spawn on closed doors and agent positions
|
||||||
|
ignore_blocking: true
|
||||||
|
spawnrule:
|
||||||
|
SpawnDestinationsPerAgent:
|
||||||
|
coords_or_quantity:
|
||||||
|
Agent_horizontal:
|
||||||
|
- (3,2)
|
||||||
|
Agent_vertical:
|
||||||
|
- (2,3)
|
||||||
|
# Whether you want to provide a numeric Position observation.
|
||||||
|
# GlobalPositions:
|
||||||
|
# normalized: false
|
||||||
|
|
||||||
|
# Define the env. dynamics
|
||||||
|
Rules:
|
||||||
|
# Utilities
|
||||||
|
# This rule Checks for Collision, also it assigns the (negative) reward
|
||||||
|
WatchCollisions:
|
||||||
|
reward: -0.1
|
||||||
|
reward_at_done: -1
|
||||||
|
done_at_collisions: false
|
||||||
|
# Done Conditions
|
||||||
|
# Load any of the rules, to check for done conditions.
|
||||||
|
DoneAtDestinationReach:
|
||||||
|
reward_at_done: 1
|
||||||
|
# We want to give rewards only, when all targets have been reached.
|
||||||
|
condition: "all"
|
||||||
|
DoneAtMaxStepsReached:
|
||||||
|
max_steps: 200
|
5
marl_factory_grid/levels/simple_crossing.txt
Normal file
5
marl_factory_grid/levels/simple_crossing.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#####
|
||||||
|
##-##
|
||||||
|
#---#
|
||||||
|
##-##
|
||||||
|
#####
|
@ -12,12 +12,12 @@ if __name__ == '__main__':
|
|||||||
render = True
|
render = True
|
||||||
|
|
||||||
# Path to config File
|
# Path to config File
|
||||||
path = Path('marl_factory_grid/configs/two_rooms_one_door.yaml')
|
path = Path('marl_factory_grid/configs/simple_crossing.yaml')
|
||||||
|
|
||||||
# Env Init
|
# Env Init
|
||||||
factory = Factory(path)
|
factory = Factory(path)
|
||||||
|
|
||||||
for episode in trange(10):
|
for episode in trange(1):
|
||||||
_ = factory.reset()
|
_ = factory.reset()
|
||||||
done = False
|
done = False
|
||||||
if render:
|
if render:
|
||||||
|
Reference in New Issue
Block a user