VecEnv
Full path:
schola.sb3.env.VecEnv
schola.sb3.env.VecEnv
VecEnv
VecEnv(simulator, protocol, verbosity=0)Bases: VecEnv
Stable-Baselines3 vectorized environment implementation for Schola.
This class wraps Schola environments to be compatible with Stable-Baselines3’s VecEnv interface, enabling use with SB3 algorithms.
Parameters
simulator (BaseSimulator)
: The simulator instance managing the simulator lifecycle.
protocol (BaseRLProtocol)
: The protocol instance for communication with the Simulator.
verbosity (int, default=0)
: The verbosity level for logging.
Methods
| Item | Description |
|---|---|
| init | — |
| close | — |
| env_is_wrapped | — |
| env_method | Call a method on the underlying environments. |
| get_attr | Get an attribute from the underlying environments. |
| reset | — |
| set_attr | Set an attribute on the underlying environments. |
| step_async | — |
| step_wait | — |
init
__init__(simulator, protocol, verbosity=0)Parameters
simulator (BaseSimulator)
protocol (BaseRLProtocol)
verbosity (int)
close
close()Returns
None
env_is_wrapped
env_is_wrapped(wrapper_class, indices=None)Returns
bool
env_method
env_method(*method_args, indices=None, **method_kwargs)Call a method on the underlying environments.
Parameters
method_name (str)
: The name of the method to call.
*method_args
: Positional arguments for the method.
indices (list, optional)
: Indices of environments to call the method on.
**method_kwargs
: Keyword arguments for the method.
Notes
This method is not fully implemented as sub-environments are not individually accessible in the Schola implementation.
get_attr
get_attr(attr_name, indices=None)Get an attribute from the underlying environments.
Parameters
attr_name (str)
: The name of the attribute to retrieve.
indices (list, optional)
: Indices of environments to get the attribute from.
Returns
A list of None values, as sub-environments are not individually accessible.
Return type: list
Notes
This method always returns None values because Schola environments do not expose individual sub-environment attributes.
reset
reset()Returns
Dict[str, ndarray]
set_attr
set_attr(attr_name, value, indices=None)Set an attribute on the underlying environments.
Parameters
attr_name (str)
: The name of the attribute to set.
value (Any)
: The value to set the attribute to.
indices (list, optional)
: Indices of environments to set the attribute on.
Notes
This method is not fully implemented as sub-environments are not individually accessible in the Schola implementation.
step_async
step_async(actions)Parameters
actions (ndarray)
Returns
None
step_wait
step_wait()Returns
Tuple[Dict[str, ndarray], ndarray, ndarray, List[Dict[str, str]]]