smarts.env.gymnasium.driving_smarts_2023_env module
- smarts.env.gymnasium.driving_smarts_2023_env.driving_smarts_2023_env(scenario: str, agent_interface: AgentInterface, seed: int = 42, headless: bool = True, sumo_headless: bool = True, envision_record_data_replay_path: str | None = None)[source]
An environment with a mission to be completed by a single or multiple ego agents. Episode ends when ego agents reach their respective destinations specified by their mission goals.
- Observation space for each agent:
Formatted
Observation
usingmulti_agent
option is returned as observation. SeeObservationSpacesFormatter
for a sample formatted observation data structure.- Action space for each agent:
Action space for an ego can be either
Continuous
orRelativeTargetPose
. User should choose one of the action spaces and specify the chosen action space through the ego’s agent interface.- Agent interface:
Using the input argument agent_interface, users may configure any field of
AgentInterface
, except- Reward:
Default reward is distance travelled (in meters) in each step, including the termination step.
- Episode termination:
Episode is terminated if any of the following occurs.
Egos reach their respective destinations specified by their mission goals.
Steps per episode exceed 1000.
Agent collides or drives off road.
- Parameters:
scenario (str) – Scenario name or path to scenario folder.
agent_interface (AgentInterface) – Agent interface specification.
seed (int, optional) – Random number generator seed. Defaults to 42.
headless (bool, optional) – If True, disables visualization in Envision. Defaults to False.
sumo_headless (bool, optional) – If True, disables visualization in SUMO GUI. Defaults to True.
envision_record_data_replay_path (Optional[str], optional) – Envision’s data replay output directory. Defaults to None.
- Returns:
An environment described by the input argument scenario.
- smarts.env.gymnasium.driving_smarts_2023_env.resolve_agent_interface(agent_interface: AgentInterface)[source]
Resolve the agent interface for a given environment. Some interface values can be configured by the user, but others are pre-determined and fixed.