1- # Copyright (c) 2022.
1+ # Copyright (c) 2022-2024 .
22# ProrokLab (https://www.proroklab.org/)
33# All rights reserved.
44
1414import numpy as np
1515import tikzplotlib
1616import torch
17- from matplotlib import pyplot as plt
1817
1918import vmas
19+ from matplotlib import pyplot as plt
2020
2121
2222def mpe_make_env (scenario_name ):
23- from mpe .multiagent .environment import MultiAgentEnv
2423 import mpe .multiagent .scenarios as scenarios
24+ from mpe .multiagent .environment import MultiAgentEnv
2525
2626 # load scenario from script
2727 scenario = scenarios .load (scenario_name + ".py" ).Scenario ()
@@ -44,10 +44,10 @@ def run_mpe_simple_spread(n_envs: int, n_steps: int):
4444 [env .reset () for env in envs ]
4545 init_time = time .time ()
4646
47- for step in range (n_steps ):
47+ for _ in range (n_steps ):
4848 for env_idx in range (n_envs ):
4949 actions = []
50- for i in range (n_agents ):
50+ for _ in range (n_agents ):
5151 actions .append (simple_shared_action )
5252 envs [env_idx ].step (actions )
5353
@@ -72,9 +72,9 @@ def run_vmas_simple_spread(n_envs: int, n_steps: int, device: str):
7272 env .reset ()
7373 init_time = time .time ()
7474
75- for step in range (n_steps ):
75+ for _ in range (n_steps ):
7676 actions = []
77- for i in range (n_agents ):
77+ for _ in range (n_agents ):
7878 actions .append (
7979 torch .tensor (
8080 simple_shared_action ,
@@ -101,11 +101,11 @@ def get_device_name(torch_device: str):
101101 if "model name" in line :
102102 return re .sub (".*model name.*:" , "" , line , 1 )
103103 else :
104- assert False
104+ raise AssertionError ()
105105 elif torch_device == "cuda" :
106106 return torch .cuda .get_device_name ()
107107 else :
108- assert False
108+ raise AssertionError ()
109109
110110
111111def store_pickled_evaluation (name : str , evaluation : list ):
0 commit comments