Rollout#

class enki_env.rollout.Rollout(observation: Observation, action: Action, reward: Array, termination: BoolArray, truncation: BoolArray, info: dict[str, MaskedArray], valid: BoolArray, robots: list[str])#

Bases: object

Holds data collected during a rollout, like by enki_env.ParallelEnkiEnv.rollout() and enki_env.EnkiEnv.rollout().

action: Action#

An array of shape (#steps, #robots, *shape of actions) with the actions at each step for each robots. Validity in stored separately in valid.

property episode_length: int#

The number of steps

Returns:

The steps.

property episode_reward: float#

Returns the average (over robots) of cumulative (over steps) rewards.

Returns:

The episode reward.

property episode_success: BoolArray | None#

The final info["is_success"] for each robot.

Returns:

An array of Booleans.

info: dict[str, MaskedArray]#

A dictionary where the value is a masked array of shape (#steps, #robots, *shape of info) aggregates all the information entries for the given key at each step for all robots. The array mask record which entries were present at a given time step for a given robot.

property length: ndarray[tuple[Any, ...], dtype[int64]]#

The number of steps done by each robot.

Returns:

An array of integers of length #robots

property masked_action: MaskedArray#

Returns the actions as masked array.

Returns:

The actions.

property masked_observation: dict[str, MaskedArray]#

Returns the observations as dictionary of masked array.

Returns:

The observations.

property masked_reward: MaskedArray#

Returns the rewards as masked array.

Returns:

The rewards.

observation: Observation#

A dictionary of arrays for each key in the observation space. Array have shape (#steps, #robots, *shape of observation) with the value of the observation at each step for each robots. Validity in stored separately in valid.

reward: Array#

An array of shape (#steps, #robots) with the rewards at each step for each robots. Validity in stored separately in valid.

robots: list[str]#

The name of the robots in the same order as the data fields.

termination: BoolArray#

An array of length #robots that stores whether the robots were terminated.

truncation: BoolArray#

An array of length #robots that stores whether the robots were truncated

valid: BoolArray#

An array of shape (#steps + 1, #robots) of Booleans where valid(i, j) == True iff robot j was alive at time i.