Examples

Examples#

navground.learning.examples

Corridor#

The environment of Corridor with obstacle.

Creates the an environment where a single agent traveling along a corridor with a single static obstacle.

Parameters:
  • flat (bool) – Whether the observation space is flat

  • duration (float) – The duration of an episode

  • time_step (float) – The simulation time step

Returns:

A Gymnasium environment

Return type:

Env[dict[str, ndarray[Any, dtype[Any]]] | ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]

Crossing#

The single and multi-agent environments of Crossing.

Creates the an environment where 20 agents travel back and forth between way-points, crossing in the middle.

Parameters:
  • flat (bool) – Whether the observation space is flat

  • use_acceleration_action (bool) – Whether actions are acceleration or velocities

  • multi_agent (bool) – Whether to expose all agents or just one.

  • kwargs (Any) – Arguments passed to the environment constructor

Returns:

A Parallel PettingZoo environment if multi_agent is set, else a Gymnasium environment.

Return type:

Env[dict[str, ndarray[Any, dtype[Any]]] | ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] | ParallelEnv[int, dict[str, ndarray[Any, dtype[Any]]] | ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]