diff --git a/benchmarl/conf/task/vmas/ball_passage.yaml b/benchmarl/conf/task/vmas/ball_passage.yaml new file mode 100644 index 00000000..26cbf773 --- /dev/null +++ b/benchmarl/conf/task/vmas/ball_passage.yaml @@ -0,0 +1,8 @@ +defaults: + - _self_ + - vmas_ball_passage_config + +max_steps: 500 +n_passages: 1 +fixed_passage: False +random_start_angle: True diff --git a/benchmarl/conf/task/vmas/ball_trajectory.yaml b/benchmarl/conf/task/vmas/ball_trajectory.yaml new file mode 100644 index 00000000..5babd799 --- /dev/null +++ b/benchmarl/conf/task/vmas/ball_trajectory.yaml @@ -0,0 +1,6 @@ +defaults: + - _self_ + - vmas_ball_trajectory_config + +max_steps: 100 +joints: True diff --git a/benchmarl/conf/task/vmas/buzz_wire.yaml b/benchmarl/conf/task/vmas/buzz_wire.yaml new file mode 100644 index 00000000..7dc696b3 --- /dev/null +++ b/benchmarl/conf/task/vmas/buzz_wire.yaml @@ -0,0 +1,7 @@ +defaults: + - _self_ + - vmas_buzz_wire_config + +max_steps: 100 +random_start_angle: True +collision_reward: -10 diff --git a/benchmarl/conf/task/vmas/discovery.yaml b/benchmarl/conf/task/vmas/discovery.yaml new file mode 100644 index 00000000..129ccf51 --- /dev/null +++ b/benchmarl/conf/task/vmas/discovery.yaml @@ -0,0 +1,12 @@ +defaults: + - _self_ + - vmas_discovery_config + +max_steps: 100 +n_agents: 5 +n_targets: 7 +lidar_range: 0.35 +covering_range: 0.25 +agents_per_target: 2 +targets_respawn: True +shared_reward: True diff --git a/benchmarl/conf/task/vmas/flocking.yaml b/benchmarl/conf/task/vmas/flocking.yaml new file mode 100644 index 00000000..dafc0cc4 --- /dev/null +++ b/benchmarl/conf/task/vmas/flocking.yaml @@ -0,0 +1,8 @@ +defaults: + - _self_ + - vmas_flocking_config + +max_steps: 100 +n_agents: 4 +n_targets: 5 +collision_reward: -0.1 diff --git a/benchmarl/conf/task/vmas/joint_passage.yaml b/benchmarl/conf/task/vmas/joint_passage.yaml new file mode 100644 index 00000000..918840b4 --- /dev/null +++ b/benchmarl/conf/task/vmas/joint_passage.yaml @@ -0,0 +1,14 @@ +defaults: + - _self_ + - vmas_joint_passage_config + +max_steps: 500 +n_passages: 1 +fixed_passage: True +joint_length: 0.5 +random_start_angle: True +random_goal_angle: True +observe_joint_angle: False +asym_package: True +mass_ratio: 5 +mass_position: 0.75 diff --git a/benchmarl/conf/task/vmas/joint_passage_size.yaml b/benchmarl/conf/task/vmas/joint_passage_size.yaml new file mode 100644 index 00000000..ae7fe78e --- /dev/null +++ b/benchmarl/conf/task/vmas/joint_passage_size.yaml @@ -0,0 +1,10 @@ +defaults: + - _self_ + - vmas_joint_passage_size_config + +max_steps: 500 +n_passages: 3 +fixed_passage: False +random_start_angle: False +random_goal_angle: False +observe_joint_angle: False diff --git a/benchmarl/conf/task/vmas/multi_give_way.yaml b/benchmarl/conf/task/vmas/multi_give_way.yaml new file mode 100644 index 00000000..8c57ba7a --- /dev/null +++ b/benchmarl/conf/task/vmas/multi_give_way.yaml @@ -0,0 +1,6 @@ +defaults: + - _self_ + - vmas_multi_give_way_config + +max_steps: 200 +agent_collision_penalty: -0.1 diff --git a/benchmarl/conf/task/vmas/passage.yaml b/benchmarl/conf/task/vmas/passage.yaml new file mode 100644 index 00000000..af625b49 --- /dev/null +++ b/benchmarl/conf/task/vmas/passage.yaml @@ -0,0 +1,7 @@ +defaults: + - _self_ + - vmas_passage_config + +max_steps: 500 +n_passages: 1 +shared_reward: True diff --git a/benchmarl/environments/__init__.py b/benchmarl/environments/__init__.py index c6359305..3fa78b0a 100644 --- a/benchmarl/environments/__init__.py +++ b/benchmarl/environments/__init__.py @@ -21,7 +21,7 @@ from .pettingzoo.multiwalker import TaskConfig as MultiwalkerConfig -from .pettingzoo.simple_adverasary import TaskConfig as SimpleAdversaryConfig +from .pettingzoo.simple_adversary import TaskConfig as SimpleAdversaryConfig from .pettingzoo.simple_crypto import TaskConfig as SimpleCryptoConfig from .pettingzoo.simple_push import TaskConfig as SimplePushConfig from .pettingzoo.simple_reference import TaskConfig as SimpleReferenceConfig @@ -34,13 +34,22 @@ from .pettingzoo.waterworld import TaskConfig as WaterworldConfig from .vmas.balance import TaskConfig as BalanceConfig +from .vmas.ball_passage import TaskConfig as BallPassageConfig +from .vmas.ball_trajectory import TaskConfig as BallTrajectoryConfig +from .vmas.buzz_wire import TaskConfig as BuzzWireConfig +from .vmas.discovery import TaskConfig as DiscoveryConfig from .vmas.dispersion import TaskConfig as DispersionConfig from .vmas.dropout import TaskConfig as DropoutConfig +from .vmas.flocking import TaskConfig as FlockingConfig from .vmas.give_way import TaskConfig as GiveWayConfig +from .vmas.joint_passage import TaskConfig as JointPassageConfig +from .vmas.joint_passage_size import TaskConfig as JointPassageSizeConfig +from .vmas.multi_give_way import TaskConfig as MultiGiveWayConfig from .vmas.navigation import TaskConfig as NavigationConfig +from .vmas.passage import TaskConfig as PassageConfig from .vmas.reverse_transport import TaskConfig as ReverseTransportConfig from .vmas.sampling import TaskConfig as SamplingConfig -from .vmas.simple_adverasary import TaskConfig as VmasSimpleAdversaryConfig +from .vmas.simple_adversary import TaskConfig as VmasSimpleAdversaryConfig from .vmas.simple_crypto import TaskConfig as VmasSimpleCryptoConfig from .vmas.simple_push import TaskConfig as VmasSimplePushConfig from .vmas.simple_reference import TaskConfig as VmasSimpleReferenceConfig @@ -52,7 +61,6 @@ from .vmas.wheel import TaskConfig as WheelConfig from .vmas.wind_flocking import TaskConfig as WindFlockingConfig - # This is a registry mapping task config schemas names to their python dataclass # It is used by hydra to validate loaded configs. # You will see the "envname_taskname_config" strings in the hydra defaults at the top of yaml files. @@ -66,8 +74,17 @@ "vmas_wheel_config": WheelConfig, "vmas_dispersion_config": DispersionConfig, "vmas_give_way_config": GiveWayConfig, + "vmas_multi_give_way_config": MultiGiveWayConfig, + "vmas_passage_config": PassageConfig, + "vmas_joint_passage_config": JointPassageConfig, + "vmas_joint_passage_size_config": JointPassageSizeConfig, + "vmas_ball_passage_config": BallPassageConfig, + "vmas_buzz_wire_config": BuzzWireConfig, + "vmas_ball_trajectory_config": BallTrajectoryConfig, + "vmas_flocking_config": FlockingConfig, "vmas_wind_flocking_config": WindFlockingConfig, "vmas_dropout_config": DropoutConfig, + "vmas_discovery_config": DiscoveryConfig, "vmas_simple_adversary_config": VmasSimpleAdversaryConfig, "vmas_simple_crypto_config": VmasSimpleCryptoConfig, "vmas_simple_push_config": VmasSimplePushConfig, diff --git a/benchmarl/environments/pettingzoo/simple_adverasary.py b/benchmarl/environments/pettingzoo/simple_adversary.py similarity index 100% rename from benchmarl/environments/pettingzoo/simple_adverasary.py rename to benchmarl/environments/pettingzoo/simple_adversary.py diff --git a/benchmarl/environments/pettingzoo/simple_reference.py b/benchmarl/environments/pettingzoo/simple_reference.py index d2c37d56..bdee5e15 100644 --- a/benchmarl/environments/pettingzoo/simple_reference.py +++ b/benchmarl/environments/pettingzoo/simple_reference.py @@ -11,3 +11,4 @@ class TaskConfig: task: str = MISSING max_cycles: int = MISSING + local_ratio: float = MISSING diff --git a/benchmarl/environments/vmas/ball_passage.py b/benchmarl/environments/vmas/ball_passage.py new file mode 100644 index 00000000..ef87aee3 --- /dev/null +++ b/benchmarl/environments/vmas/ball_passage.py @@ -0,0 +1,15 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + n_passages: int = MISSING + fixed_passage: bool = MISSING + random_start_angle: bool = MISSING diff --git a/benchmarl/environments/vmas/ball_trajectory.py b/benchmarl/environments/vmas/ball_trajectory.py new file mode 100644 index 00000000..8310e478 --- /dev/null +++ b/benchmarl/environments/vmas/ball_trajectory.py @@ -0,0 +1,13 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + joints: bool = MISSING diff --git a/benchmarl/environments/vmas/buzz_wire.py b/benchmarl/environments/vmas/buzz_wire.py new file mode 100644 index 00000000..6d682d98 --- /dev/null +++ b/benchmarl/environments/vmas/buzz_wire.py @@ -0,0 +1,14 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + random_start_angle: bool = MISSING + collision_reward: float = MISSING diff --git a/benchmarl/environments/vmas/common.py b/benchmarl/environments/vmas/common.py index c81e793c..691594e4 100644 --- a/benchmarl/environments/vmas/common.py +++ b/benchmarl/environments/vmas/common.py @@ -24,9 +24,18 @@ class VmasTask(Task): REVERSE_TRANSPORT = None WHEEL = None DISPERSION = None + MULTI_GIVE_WAY = None DROPOUT = None GIVE_WAY = None WIND_FLOCKING = None + PASSAGE = None + JOINT_PASSAGE = None + JOINT_PASSAGE_SIZE = None + BALL_PASSAGE = None + BALL_TRAJECTORY = None + BUZZ_WIRE = None + FLOCKING = None + DISCOVERY = None SIMPLE_ADVERSARY = None SIMPLE_CRYPTO = None SIMPLE_PUSH = None diff --git a/benchmarl/environments/vmas/discovery.py b/benchmarl/environments/vmas/discovery.py new file mode 100644 index 00000000..59613f54 --- /dev/null +++ b/benchmarl/environments/vmas/discovery.py @@ -0,0 +1,19 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + n_agents: int = MISSING + n_targets: int = MISSING + lidar_range: float = MISSING + covering_range: float = MISSING + agents_per_target: int = MISSING + targets_respawn: bool = MISSING + shared_reward: bool = MISSING diff --git a/benchmarl/environments/vmas/flocking.py b/benchmarl/environments/vmas/flocking.py new file mode 100644 index 00000000..81c9e274 --- /dev/null +++ b/benchmarl/environments/vmas/flocking.py @@ -0,0 +1,15 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + n_agents: int = MISSING + n_targets: int = MISSING + collision_reward: float = MISSING diff --git a/benchmarl/environments/vmas/joint_passage.py b/benchmarl/environments/vmas/joint_passage.py new file mode 100644 index 00000000..97606329 --- /dev/null +++ b/benchmarl/environments/vmas/joint_passage.py @@ -0,0 +1,21 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + n_passages: int = MISSING + fixed_passage: bool = MISSING + joint_length: float = MISSING + random_start_angle: bool = MISSING + random_goal_angle: bool = MISSING + observe_joint_angle: bool = MISSING + asym_package: bool = MISSING + mass_ratio: float = MISSING + mass_position: float = MISSING diff --git a/benchmarl/environments/vmas/joint_passage_size.py b/benchmarl/environments/vmas/joint_passage_size.py new file mode 100644 index 00000000..21a6e92b --- /dev/null +++ b/benchmarl/environments/vmas/joint_passage_size.py @@ -0,0 +1,17 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + n_passages: int = MISSING + fixed_passage: bool = MISSING + random_start_angle: bool = MISSING + random_goal_angle: bool = MISSING + observe_joint_angle: bool = MISSING diff --git a/benchmarl/environments/vmas/multi_give_way.py b/benchmarl/environments/vmas/multi_give_way.py new file mode 100644 index 00000000..d1ac1589 --- /dev/null +++ b/benchmarl/environments/vmas/multi_give_way.py @@ -0,0 +1,13 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + agent_collision_penalty: float = MISSING diff --git a/benchmarl/environments/vmas/passage.py b/benchmarl/environments/vmas/passage.py new file mode 100644 index 00000000..6fdc680f --- /dev/null +++ b/benchmarl/environments/vmas/passage.py @@ -0,0 +1,14 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# + +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + n_passages: int = MISSING + shared_reward: bool = MISSING diff --git a/benchmarl/environments/vmas/simple_adverasary.py b/benchmarl/environments/vmas/simple_adversary.py similarity index 100% rename from benchmarl/environments/vmas/simple_adverasary.py rename to benchmarl/environments/vmas/simple_adversary.py