added simple_crossing scenario

This commit is contained in:
Chanumask
2024-03-25 13:08:37 +01:00
parent 955598a129
commit 1e4ec254f4
3 changed files with 77 additions and 2 deletions

View 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

View File

@ -0,0 +1,5 @@
#####
##-##
#---#
##-##
#####

View File

@ -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: