igp2.simplesim package

Submodules

igp2.simplesim.plot_simulation module

igp2.simplesim.plot_simulation.plot_diagnostics(agents: ~typing.Dict[int, ~igp2.agents.agent.Agent], actions: ~typing.Dict[int, ~typing.List[~igp2.core.vehicle.Action]]) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
igp2.simplesim.plot_simulation.plot_maneuvers(agent: Agent, ax: Axes) Axes[source]
igp2.simplesim.plot_simulation.plot_predictions(ego_agent: MCTSAgent, agents: Dict[int, Agent], ax: Axes, debug: bool = False) Axes[source]
igp2.simplesim.plot_simulation.plot_simulation(simulation: ~igp2.simplesim.simulation.Simulation, axes: ~matplotlib.axes._axes.Axes | None = None, debug: bool = False) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]

Plot the current agents and the road layout for visualisation purposes.

Parameters:
  • simulation – The simulation to plot.

  • axes – Axis to draw on

  • debug – If True then plot diagnostic information.

igp2.simplesim.simulation module

class igp2.simplesim.simulation.Simulation(scenario_map: Map, fps: int = 20, open_loop: bool = False)[source]

Bases: object

A lightweight simulator for IGP2 to perform rapid testing.

property actions: Dict[int, List[Action]]

List of actions (acceleration and steering) taken by every vehicle.

add_agent(new_agent: Agent, rolename: str | None = None)[source]

Add a new agent to the simulation.

Parameters:
  • new_agent – Agent to add.

  • rolename – Currently unused. Optional string to describe role of the vehicle.

property agents: Dict[int, Agent]

Agents in the simulation, mapping agent IDs to agents.

remove_agent(agent_id: int)[source]

Remove an agent from the simulation.

Parameters:

agent_id – Agent ID to remove.

reset()[source]

Remove all agents and reset internal state of simulation.

property scenario_map: Map

The road layout of the simulation.

step()[source]

Advance simulation by one time step.

property t: int

The current time step of the simulation.

Module contents