scenic.core.dynamics.actions
Actions taken by dynamic agents.
Summary of Module Members
Classes
An action which can be taken by an agent for one step of a simulation. |
Member Details
- class Action[source]
Bases:
ABC
An action which can be taken by an agent for one step of a simulation.
- canBeTakenBy(agent)[source]
Whether this action is allowed to be taken by the given agent.
The default implementation always returns True.
- abstract applyTo(agent, simulation)[source]
Apply this action to the given agent in the given simulation.
This method should call simulator APIs so that the agent will take this action during the next simulated time step. Depending on the simulator API, it may be necessary to batch each agent’s actions into a single update: in that case you can have this method set some state on the agent, then apply the actual update in an overridden implementation of
Simulation.executeActions
. For examples, see the CARLA interface:scenic.simulators.carla.actions
has some CARLA-specific actions which directly call CARLA APIs, while the generic steering and braking actions fromscenic.domains.driving.actions
are implemented using the batching approach (see for example thesetThrottle
method of the classscenic.simulators.carla.model.Vehicle
, which sets state later read byCarlaSimulation.executeActions
inscenic.simulators.carla.simulator
).