smarts.env.gymnasium.driving_smarts_2022_env module
- smarts.env.gymnasium.driving_smarts_2022_env.driving_smarts_2022_env(scenario: str, agent_interface: AgentInterface, headless: bool = True, seed: int = 42, visdom: bool = False, 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.
- Observation space for each agent:
An unformatted
Observation
is returned as observation.- Action space for each agent:
Action space for each agent is configured through its AgentInterface. The action space could be either of the following.
Action
Values
Units
Δx-coordinate
[-2.8, 2.8]
m
Δy-coordinate
[-2.8, 2.8]
m
Δheading
[-π, π]
rad
Action
Values
Units
Next x-coordinate
[-1e10, 1e10]
m
Next y-coordinate
[-1e10, 1e10]
m
Heading with respect to map’s axes
[-π, π]
rad
ΔTime
0.1
s
- Reward:
Reward is distance travelled (in meters) in each step, including the termination step.
- Episode termination:
Episode is terminated if any of the following occurs.
Steps per episode exceed 800.
Agent collides, drives off road, drives off route, or drives on wrong way.
- Parameters:
scenario (str) – Scenario name or path to scenario folder.
agent_interface (AgentInterface) – Agent interface specification.
headless (bool, optional) – If True, disables visualization in Envision. Defaults to False.
seed (int, optional) – Random number generator seed. Defaults to 42.
visdom (bool, optional) – If True, enables visualization of observed RGB images in visdom. 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_2022_env.resolve_agent_action_space(agent_interface: AgentInterface)[source]
Get the competition action space for the given agent interface.
- smarts.env.gymnasium.driving_smarts_2022_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.
- smarts.env.gymnasium.driving_smarts_2022_env.resolve_env_action_space(agent_interfaces: Dict[str, AgentInterface])[source]
Get the environment action space for the given set of agent interfaces.