Wrappers
navground.learning.wrappers
-
class MaskWrapper(env: ParallelEnv[int, Observation, Action], observation_indices: Iterable[int] = (), observation_keys: Iterable[str] = (), action_indices: Iterable[int] = ())
Bases: BaseParallelWrapper[int, dict[str, ndarray[tuple[Any, …], dtype[Any]]] | ndarray[tuple[Any, …], dtype[Any]], ndarray[tuple[Any, …], dtype[Any]]]
This wrapper masks some of the observations and/or actions
- Parameters:
env (ParallelEnv[int, Observation, Action]) – The wrapped environment
observation_indices (Iterable[int]) – Which observation indices to keep (if array)
observation_keys (Iterable[str]) – Which observation keys to keep (if dict)
action_indices (Iterable[int]) – Which action indices to keep (if array)
-
class NameWrapper(env: BaseParallelEnv)
Bases: BaseParallelWrapper[str, dict[str, ndarray[tuple[Any, …], dtype[Any]]] | ndarray[tuple[Any, …], dtype[Any]], ndarray[tuple[Any, …], dtype[Any]]]
This wrapper renames the agent using their navground tags
as prefix “tag1-tag2-…-tagn” or “agent” (if no tag is set).
Indices are appended to the predix, e.g.
agent_0, agent_1, … .
- Parameters:
env (BaseParallelEnv) – The wrapped environment