You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
seed (int, optional): Seed for the environment. Defaults to None.
315
+
316
+
"""
191
317
ifseedisNone:
192
318
seed=0
193
319
torch.manual_seed(seed)
194
320
np.random.seed(seed)
195
321
random.seed(seed)
196
322
return [seed]
197
323
324
+
@local_seed(vmas_random_state)
198
325
defstep(self, actions: Union[List, Dict]):
199
326
"""Performs a vectorized step on all sub environments using `actions`.
327
+
200
328
Args:
201
-
actions: Is a list on len 'self.n_agents' of which each element is a torch.Tensor of shape
202
-
'(self.num_envs, action_size_of_agent)'.
329
+
actions: Is a list on len 'self.n_agents' of which each element is a torch.Tensor of shape '(self.num_envs, action_size_of_agent)'.
330
+
203
331
Returns:
204
-
obs: List on len 'self.n_agents' of which each element is a torch.Tensor
205
-
of shape '(self.num_envs, obs_size_of_agent)'
332
+
obs: List on len 'self.n_agents' of which each element is a torch.Tensor of shape '(self.num_envs, obs_size_of_agent)'
206
333
rewards: List on len 'self.n_agents' of which each element is a torch.Tensor of shape '(self.num_envs)'
207
334
dones: Tensor of len 'self.num_envs' of which each element is a bool
208
-
infos : List on len 'self.n_agents' of which each element is a dictionary for which each key is a metric
209
-
and the value is a tensor of shape '(self.num_envs, metric_size_per_agent)'
335
+
infos: List on len 'self.n_agents' of which each element is a dictionary for which each key is a metric and the value is a tensor of shape '(self.num_envs, metric_size_per_agent)'
:param env_index: Index of the environment to render
645
-
:param agent_index_focus: If specified the camera will stay on the agent with this index.
646
-
If None, the camera will stay in the center and zoom out to contain all agents
782
+
:param agent_index_focus: If specified the camera will stay on the agent with this index. If None, the camera will stay in the center and zoom out to contain all agents
647
783
:param visualize_when_rgb: Also run human visualization when mode=="rgb_array"
648
784
:param plot_position_function: A function to plot under the rendering.
649
785
The function takes a numpy array with shape (n_points, 2), which represents a set of x,y values to evaluate f over and plot it
@@ -657,6 +793,7 @@ def render(
657
793
:param plot_position_function_cmap_range: The range of the cmap in case plot_position_function outputs a single value
658
794
:param plot_position_function_cmap_alpha: The alpha of the cmap in case plot_position_function outputs a single value
0 commit comments