diff --git a/benchmarl/conf/task/smacv2/protoss_10_vs_10.yaml b/benchmarl/conf/task/smacv2/protoss_10_vs_10.yaml new file mode 100644 index 00000000..47804bd0 --- /dev/null +++ b/benchmarl/conf/task/smacv2/protoss_10_vs_10.yaml @@ -0,0 +1,59 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_protoss" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +obs_own_pos: True +num_fov_actions: 12 +capability_config: + n_units: 10 + n_enemies: 10 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "stalker" + - "zealot" + - "colossus" + weights: + - 0.45 + - 0.45 + - 0.1 + observe: True + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/protoss_10_vs_11.yaml b/benchmarl/conf/task/smacv2/protoss_10_vs_11.yaml new file mode 100644 index 00000000..3087c49c --- /dev/null +++ b/benchmarl/conf/task/smacv2/protoss_10_vs_11.yaml @@ -0,0 +1,59 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_protoss" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +obs_own_pos: True +num_fov_actions: 12 +capability_config: + n_units: 10 + n_enemies: 11 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "stalker" + - "zealot" + - "colossus" + weights: + - 0.45 + - 0.45 + - 0.1 + observe: True + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/protoss_20_vs_20.yaml b/benchmarl/conf/task/smacv2/protoss_20_vs_20.yaml new file mode 100644 index 00000000..5ba48e23 --- /dev/null +++ b/benchmarl/conf/task/smacv2/protoss_20_vs_20.yaml @@ -0,0 +1,59 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_protoss" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +obs_own_pos: True +num_fov_actions: 12 +capability_config: + n_units: 20 + n_enemies: 20 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "stalker" + - "zealot" + - "colossus" + weights: + - 0.45 + - 0.45 + - 0.1 + observe: True + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/protoss_20_vs_23.yaml b/benchmarl/conf/task/smacv2/protoss_20_vs_23.yaml new file mode 100644 index 00000000..7467e784 --- /dev/null +++ b/benchmarl/conf/task/smacv2/protoss_20_vs_23.yaml @@ -0,0 +1,59 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_protoss" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +obs_own_pos: True +num_fov_actions: 12 +capability_config: + n_units: 20 + n_enemies: 23 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "stalker" + - "zealot" + - "colossus" + weights: + - 0.45 + - 0.45 + - 0.1 + observe: True + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/terran_10_vs_10.yaml b/benchmarl/conf/task/smacv2/terran_10_vs_10.yaml new file mode 100644 index 00000000..0142b249 --- /dev/null +++ b/benchmarl/conf/task/smacv2/terran_10_vs_10.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_terran" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +obs_own_pos: True +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +capability_config: + n_units: 10 + n_enemies: 10 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "marine" + - "marauder" + - "medivac" + weights: + - 0.45 + - 0.45 + - 0.1 + exception_unit_types: + - "medivac" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/terran_10_vs_11.yaml b/benchmarl/conf/task/smacv2/terran_10_vs_11.yaml new file mode 100644 index 00000000..2b665626 --- /dev/null +++ b/benchmarl/conf/task/smacv2/terran_10_vs_11.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_terran" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +obs_own_pos: True +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +capability_config: + n_units: 10 + n_enemies: 11 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "marine" + - "marauder" + - "medivac" + weights: + - 0.45 + - 0.45 + - 0.1 + exception_unit_types: + - "medivac" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/terran_20_vs_20.yaml b/benchmarl/conf/task/smacv2/terran_20_vs_20.yaml new file mode 100644 index 00000000..37c527cc --- /dev/null +++ b/benchmarl/conf/task/smacv2/terran_20_vs_20.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_terran" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +obs_own_pos: True +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +capability_config: + n_units: 20 + n_enemies: 20 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "marine" + - "marauder" + - "medivac" + weights: + - 0.45 + - 0.45 + - 0.1 + exception_unit_types: + - "medivac" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/terran_20_vs_23.yaml b/benchmarl/conf/task/smacv2/terran_20_vs_23.yaml new file mode 100644 index 00000000..3ca240ac --- /dev/null +++ b/benchmarl/conf/task/smacv2/terran_20_vs_23.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_terran" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +obs_own_pos: True +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +capability_config: + n_units: 20 + n_enemies: 23 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "marine" + - "marauder" + - "medivac" + weights: + - 0.45 + - 0.45 + - 0.1 + exception_unit_types: + - "medivac" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/terran_5_vs_5.yaml b/benchmarl/conf/task/smacv2/terran_5_vs_5.yaml new file mode 100644 index 00000000..6a931372 --- /dev/null +++ b/benchmarl/conf/task/smacv2/terran_5_vs_5.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_terran" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +obs_own_pos: True +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +capability_config: + n_units: 5 + n_enemies: 5 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "marine" + - "marauder" + - "medivac" + weights: + - 0.45 + - 0.45 + - 0.1 + exception_unit_types: + - "medivac" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/zerg_10_vs_10.yaml b/benchmarl/conf/task/smacv2/zerg_10_vs_10.yaml new file mode 100644 index 00000000..ee907f2d --- /dev/null +++ b/benchmarl/conf/task/smacv2/zerg_10_vs_10.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_zerg" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +obs_own_pos: True +capability_config: + n_units: 10 + n_enemies: 10 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "zergling" + - "baneling" + - "hydralisk" + weights: + - 0.45 + - 0.1 + - 0.45 + exception_unit_types: + - "baneling" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/zerg_10_vs_11.yaml b/benchmarl/conf/task/smacv2/zerg_10_vs_11.yaml new file mode 100644 index 00000000..cb620dcf --- /dev/null +++ b/benchmarl/conf/task/smacv2/zerg_10_vs_11.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_zerg" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +obs_own_pos: True +capability_config: + n_units: 10 + n_enemies: 11 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "zergling" + - "baneling" + - "hydralisk" + weights: + - 0.45 + - 0.1 + - 0.45 + exception_unit_types: + - "baneling" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/zerg_20_vs_20.yaml b/benchmarl/conf/task/smacv2/zerg_20_vs_20.yaml new file mode 100644 index 00000000..f93ca5df --- /dev/null +++ b/benchmarl/conf/task/smacv2/zerg_20_vs_20.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_zerg" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +obs_own_pos: True +capability_config: + n_units: 20 + n_enemies: 20 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "zergling" + - "baneling" + - "hydralisk" + weights: + - 0.45 + - 0.1 + - 0.45 + exception_unit_types: + - "baneling" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/zerg_20_vs_23.yaml b/benchmarl/conf/task/smacv2/zerg_20_vs_23.yaml new file mode 100644 index 00000000..4c5f7323 --- /dev/null +++ b/benchmarl/conf/task/smacv2/zerg_20_vs_23.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_zerg" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +obs_own_pos: True +capability_config: + n_units: 20 + n_enemies: 23 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "zergling" + - "baneling" + - "hydralisk" + weights: + - 0.45 + - 0.1 + - 0.45 + exception_unit_types: + - "baneling" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/smacv2/zerg_5_vs_5.yaml b/benchmarl/conf/task/smacv2/zerg_5_vs_5.yaml new file mode 100644 index 00000000..59c62970 --- /dev/null +++ b/benchmarl/conf/task/smacv2/zerg_5_vs_5.yaml @@ -0,0 +1,61 @@ +continuing_episode: False +difficulty: "7" +game_version: null +map_name: "10gen_zerg" +move_amount: 2 +obs_all_health: True +obs_instead_of_state: False +obs_last_action: False +obs_own_health: True +obs_pathing_grid: False +obs_terrain_height: False +obs_timestep_number: False +reward_death_value: 10 +reward_defeat: 0 +reward_negative_scale: 0.5 +reward_only_positive: True +reward_scale: True +reward_scale_rate: 20 +reward_sparse: False +reward_win: 200 +replay_dir: "" +replay_prefix: "" +conic_fov: False +use_unit_ranges: True +min_attack_range: 2 +num_fov_actions: 12 +obs_own_pos: True +capability_config: + n_units: 5 + n_enemies: 5 + team_gen: + dist_type: "weighted_teams" + unit_types: + - "zergling" + - "baneling" + - "hydralisk" + weights: + - 0.45 + - 0.1 + - 0.45 + exception_unit_types: + - "baneling" + observe: True + + start_positions: + dist_type: "surrounded_and_reflect" + p: 0.5 + map_x: 32 + map_y: 32 + # enemy_mask: + # dist_type: "mask" + # mask_probability: 0.5 + # n_enemies: 5 +state_last_action: True +state_timestep_number: False +step_mul: 8 +heuristic_ai: False +# heuristic_rest: False +debug: False +prob_obs_enemy: 1.0 +action_mask: True diff --git a/benchmarl/conf/task/vmas/balance.yaml b/benchmarl/conf/task/vmas/balance.yaml index 2e61b152..e7614ce8 100644 --- a/benchmarl/conf/task/vmas/balance.yaml +++ b/benchmarl/conf/task/vmas/balance.yaml @@ -4,4 +4,6 @@ defaults: max_steps: 100 -n_agents: 3 +n_agents: 4 +random_package_pos_on_line: True +package_mass: 5 diff --git a/benchmarl/conf/task/vmas/navigation.yaml b/benchmarl/conf/task/vmas/navigation.yaml index 2d4806e5..3a4b797a 100644 --- a/benchmarl/conf/task/vmas/navigation.yaml +++ b/benchmarl/conf/task/vmas/navigation.yaml @@ -7,5 +7,8 @@ max_steps: 100 n_agents: 3 collisions: True agents_with_same_goal: 1 +split_goals: False observe_all_goals: False shared_rew: False +lidar_range: 0.35 +agent_radius: 0.1 diff --git a/benchmarl/conf/task/vmas/sampling.yaml b/benchmarl/conf/task/vmas/sampling.yaml index 1d296889..ef570894 100644 --- a/benchmarl/conf/task/vmas/sampling.yaml +++ b/benchmarl/conf/task/vmas/sampling.yaml @@ -7,3 +7,4 @@ max_steps: 100 n_agents: 3 shared_rew: False n_gaussians: 3 +lidar_range: 0.2 diff --git a/benchmarl/conf/task/vmas/transport.yaml b/benchmarl/conf/task/vmas/transport.yaml new file mode 100644 index 00000000..7013792b --- /dev/null +++ b/benchmarl/conf/task/vmas/transport.yaml @@ -0,0 +1,11 @@ +defaults: + - _self_ + - vmas_transport_config + + +max_steps: 100 +n_agents: 4 +n_packages: 1 +package_width: 0.15 +package_length: 0.15 +package_mass: 50 diff --git a/benchmarl/conf/task/vmas/wheel.yaml b/benchmarl/conf/task/vmas/wheel.yaml new file mode 100644 index 00000000..a3aa706c --- /dev/null +++ b/benchmarl/conf/task/vmas/wheel.yaml @@ -0,0 +1,9 @@ +defaults: + - _self_ + - vmas_wheel_config + +max_steps: 100 +n_agents: 4 +line_length: 1 +line_mass: 30 +desired_velocity: 0.05 diff --git a/benchmarl/environments/__init__.py b/benchmarl/environments/__init__.py index 603888c3..7cc5a1a3 100644 --- a/benchmarl/environments/__init__.py +++ b/benchmarl/environments/__init__.py @@ -1,30 +1,30 @@ from .common import Task - from .pettingzoo.common import PettingZooTask -from .pettingzoo.multiwalker import TaskConfig as MultiwalkerConfig -from .pettingzoo.simple_tag import TaskConfig as SimpleTagConfig - from .smacv2.common import Smacv2Task -from .vmas.balance import TaskConfig as BalanceConfig from .vmas.common import VmasTask -from .vmas.navigation import TaskConfig as NavigationConfig -from .vmas.sampling import TaskConfig as SamplingConfig +task_config_registry = {} +for env in [VmasTask, Smacv2Task, PettingZooTask]: + env_config_registry = { + f"{env.env_name()}/{task.name.lower()}": task for task in env + } + task_config_registry.update(env_config_registry) -task_config_registry = { - "vmas/balance": VmasTask.BALANCE, - "vmas/sampling": VmasTask.SAMPLING, - "vmas/navigation": VmasTask.NAVIGATION, - "smacv2/protoss_5_vs_5": Smacv2Task.protoss_5_vs_5, - "pettingzoo/multiwalker": PettingZooTask.MULTIWALKER, - "pettingzoo/simple_tag": PettingZooTask.SIMPLE_TAG, -} +from .pettingzoo.multiwalker import TaskConfig as MultiwalkerConfig +from .pettingzoo.simple_tag import TaskConfig as SimpleTagConfig +from .vmas.balance import TaskConfig as BalanceConfig +from .vmas.navigation import TaskConfig as NavigationConfig +from .vmas.sampling import TaskConfig as SamplingConfig +from .vmas.transport import TaskConfig as TransportConfig +from .vmas.wheel import TaskConfig as WheelConfig _task_class_registry = { "vmas_balance_config": BalanceConfig, "vmas_sampling_config": SamplingConfig, "vmas_navigation_config": NavigationConfig, + "vmas_transport_config": TransportConfig, + "vmas_wheel_config": WheelConfig, "pettingzoo_multiwalker_config": MultiwalkerConfig, "pettingzoo_simple_tag_config": SimpleTagConfig, } diff --git a/benchmarl/environments/smacv2/common.py b/benchmarl/environments/smacv2/common.py index 9d24015b..7e620774 100644 --- a/benchmarl/environments/smacv2/common.py +++ b/benchmarl/environments/smacv2/common.py @@ -11,7 +11,21 @@ class Smacv2Task(Task): - protoss_5_vs_5 = None + PROTOSS_5_VS_5 = None + PROTOSS_10_VS_10 = None + PROTOSS_10_VS_11 = None + PROTOSS_20_VS_20 = None + PROTOSS_20_VS_23 = None + TERRAN_5_VS_5 = None + TERRAN_10_VS_10 = None + TERRAN_10_VS_11 = None + TERRAN_20_VS_20 = None + TERRAN_20_VS_23 = None + ZERG_5_VS_5 = None + ZERG_10_VS_10 = None + ZERG_10_VS_11 = None + ZERG_20_VS_20 = None + ZERG_20_VS_23 = None def get_env_fun( self, diff --git a/benchmarl/environments/vmas/balance.py b/benchmarl/environments/vmas/balance.py index 0e5fac23..12e13dc2 100644 --- a/benchmarl/environments/vmas/balance.py +++ b/benchmarl/environments/vmas/balance.py @@ -5,3 +5,5 @@ class TaskConfig: max_steps: int = MISSING n_agents: int = MISSING + random_package_pos_on_line: bool = MISSING + package_mass: float = MISSING diff --git a/benchmarl/environments/vmas/common.py b/benchmarl/environments/vmas/common.py index 6931ad9c..58d0e68e 100644 --- a/benchmarl/environments/vmas/common.py +++ b/benchmarl/environments/vmas/common.py @@ -12,6 +12,8 @@ class VmasTask(Task): BALANCE = None SAMPLING = None NAVIGATION = None + TRANSPORT = None + WHEEL = None def get_env_fun( self, @@ -53,13 +55,17 @@ def action_mask_spec(self, env: EnvBase) -> Optional[CompositeSpec]: def observation_spec(self, env: EnvBase) -> CompositeSpec: observation_spec = env.unbatched_observation_spec.clone() - del observation_spec[("agents", "info")] + if "info" in observation_spec["agents"]: + del observation_spec[("agents", "info")] return observation_spec def info_spec(self, env: EnvBase) -> Optional[CompositeSpec]: info_spec = env.unbatched_observation_spec.clone() del info_spec[("agents", "observation")] - return info_spec + if "info" in info_spec["agents"]: + return info_spec + else: + return None def action_spec(self, env: EnvBase) -> CompositeSpec: return env.unbatched_action_spec diff --git a/benchmarl/environments/vmas/navigation.py b/benchmarl/environments/vmas/navigation.py index 65eb98d5..a1b050d7 100644 --- a/benchmarl/environments/vmas/navigation.py +++ b/benchmarl/environments/vmas/navigation.py @@ -9,3 +9,6 @@ class TaskConfig: agents_with_same_goal: int = MISSING observe_all_goals: bool = MISSING shared_rew: bool = MISSING + split_goals: bool = MISSING + lidar_range: float = MISSING + agent_radius: float = MISSING diff --git a/benchmarl/environments/vmas/sampling.py b/benchmarl/environments/vmas/sampling.py index 8cd9d389..b046a965 100644 --- a/benchmarl/environments/vmas/sampling.py +++ b/benchmarl/environments/vmas/sampling.py @@ -7,3 +7,4 @@ class TaskConfig: n_agents: int = MISSING shared_rew: bool = MISSING n_gaussians: int = MISSING + lidar_range: float = MISSING diff --git a/benchmarl/environments/vmas/transport.py b/benchmarl/environments/vmas/transport.py new file mode 100644 index 00000000..1f153c5e --- /dev/null +++ b/benchmarl/environments/vmas/transport.py @@ -0,0 +1,11 @@ +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + n_agents: int = MISSING + n_packages: int = MISSING + package_width: float = MISSING + package_length: float = MISSING + package_mass: float = MISSING diff --git a/benchmarl/environments/vmas/wheel.py b/benchmarl/environments/vmas/wheel.py new file mode 100644 index 00000000..4bf1b384 --- /dev/null +++ b/benchmarl/environments/vmas/wheel.py @@ -0,0 +1,10 @@ +from dataclasses import dataclass, MISSING + + +@dataclass +class TaskConfig: + max_steps: int = MISSING + n_agents: int = MISSING + line_length: float = MISSING + line_mass: float = MISSING + desired_velocity: float = MISSING diff --git a/test/test_smacv2.py b/test/test_smacv2.py index 60cc56b1..1d75c352 100644 --- a/test/test_smacv2.py +++ b/test/test_smacv2.py @@ -2,12 +2,7 @@ import pytest -from benchmarl.algorithms import ( - algorithm_config_registry, - MappoConfig, - MasacConfig, - QmixConfig, -) +from benchmarl.algorithms import algorithm_config_registry, MappoConfig, QmixConfig from benchmarl.algorithms.common import AlgorithmConfig from benchmarl.environments import Smacv2Task from benchmarl.experiment import Experiment @@ -18,7 +13,7 @@ @pytest.mark.skipif(not _has_smacv2, reason="SMACv2 not found") class TestSmacv2: @pytest.mark.parametrize("algo_config", algorithm_config_registry.values()) - @pytest.mark.parametrize("task", list(Smacv2Task)) + @pytest.mark.parametrize("task", [Smacv2Task.PROTOSS_5_VS_5]) def test_all_algos( self, algo_config: AlgorithmConfig, task, experiment_config, mlp_sequence_config ): @@ -34,8 +29,15 @@ def test_all_algos( ) experiment.run() - @pytest.mark.parametrize("algo_config", [QmixConfig, MappoConfig, MasacConfig]) - @pytest.mark.parametrize("task", list(Smacv2Task)) + @pytest.mark.parametrize("algo_config", [QmixConfig, MappoConfig]) + @pytest.mark.parametrize( + "task", + [ + Smacv2Task.PROTOSS_5_VS_5, + Smacv2Task.ZERG_5_VS_5, + Smacv2Task.TERRAN_5_VS_5, + ], + ) def test_all_tasks( self, algo_config: AlgorithmConfig, task, experiment_config, mlp_sequence_config ): diff --git a/test/test_vmas.py b/test/test_vmas.py index d1b445d8..2d427b5e 100644 --- a/test/test_vmas.py +++ b/test/test_vmas.py @@ -7,6 +7,7 @@ IppoConfig, IsacConfig, MaddpgConfig, + MappoConfig, MasacConfig, QmixConfig, VdnConfig, @@ -25,8 +26,8 @@ class TestVmas: @pytest.mark.parametrize("algo_config", algorithm_config_registry.values()) @pytest.mark.parametrize("prefer_continuous", [True, False]) - @pytest.mark.parametrize("task", list(VmasTask)) - def test_all_algos_all_tasks( + @pytest.mark.parametrize("task", [VmasTask.BALANCE]) + def test_all_algos( self, algo_config: AlgorithmConfig, task: Task, @@ -51,6 +52,26 @@ def test_all_algos_all_tasks( ) experiment.run() + @pytest.mark.parametrize("algo_config", [MappoConfig, QmixConfig]) + @pytest.mark.parametrize("task", list(VmasTask)) + def test_all_tasks( + self, + algo_config: AlgorithmConfig, + task: Task, + experiment_config, + mlp_sequence_config, + ): + + task = task.get_from_yaml() + experiment = Experiment( + algorithm_config=algo_config.get_from_yaml(), + model_config=mlp_sequence_config, + seed=0, + config=experiment_config, + task=task, + ) + experiment.run() + @pytest.mark.parametrize("algo_config", algorithm_config_registry.values()) @pytest.mark.parametrize("task", [VmasTask.BALANCE]) def test_reloading_trainer(