diff --git a/marl_factory_grid/configs/simple_crossing.yaml b/marl_factory_grid/configs/simple_crossing.yaml new file mode 100644 index 0000000..bcc0cc8 --- /dev/null +++ b/marl_factory_grid/configs/simple_crossing.yaml @@ -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 diff --git a/marl_factory_grid/levels/simple_crossing.txt b/marl_factory_grid/levels/simple_crossing.txt new file mode 100644 index 0000000..78f48a3 --- /dev/null +++ b/marl_factory_grid/levels/simple_crossing.txt @@ -0,0 +1,5 @@ +##### +##-## +#---# +##-## +##### \ No newline at end of file diff --git a/test_run.py b/test_run.py index df7200f..b19df29 100644 --- a/test_run.py +++ b/test_run.py @@ -12,12 +12,12 @@ if __name__ == '__main__': render = True # 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 factory = Factory(path) - for episode in trange(10): + for episode in trange(1): _ = factory.reset() done = False if render: