A primitive operation executed by an agent during a single step of a dynamic simulation. For example, a car might take an action which sets its throttle, or turns on its headlights. Actions are defined by the simulator interfaces (or abstract domains like
scenic.domains.driving) as subclasses of
- dynamic behavior¶
A function defining the behavior of an agent during a simulation. The function runs in parallel with the simulation, taking actions at each time step. See our tutorial on Dynamic Scenarios for examples.
- dynamic properties¶
Properties of Scenic objects which are updated at each time step of a dynamic simulation. The built-in properties representing positions, orientations, velocities, etc. are all dynamic (see Object). See the source code of
scenic.domains.driving.model.DrivingObjectfor an example of defining a dynamic property.
- external parameters¶
Values which are determined by an external tool instead of Scenic’s own sampler. These allow using optimization or other techniques to explore parameters of Scenic scenarios beyond simple random sampling. For how to define external parameters or interface to new external samplers, see
- modular scenario¶
A scenario defined using the
scenariostatement (rather than simply being the content of a Scenic file). Such scenarios can take arguments, be instantiated multiple times, and be composed with other scenarios: see Composing Scenarios.
A function which runs in parallel with a simulation, rejecting or terminating the simulation if conditions of interest are met (using the
terminatestatements). Monitors use similar syntax to dynamic behaviors, except that they are not associated with a specific Object and do not take actions (only using
waitto advance time).
- preferred orientation¶
A Vector Field set as the
orientationattribute of a Region, indicating that objects placed within that region should be oriented to align along that vector field unless otherwise specified. For example, the
roadregion provided by the Driving Domain has as its preferred orientation the
roadDirectionvector field, so that vehicles positioned using the specifier
on roadwill be facing the nominal traffic direction at their position by default (i.e., the specifier specifies
headingoptionally, so that an explicit
facing Hspecifier will override it).
- visible region¶
The Region which is “visible” from a given Object for the purposes of the
can seeoperator, the
visiblespecifier, etc. Scenic uses a simple visibility model where each object has a view cone and occlusion is ignored: see the documentation of the
can seeoperator for details.
- world model¶
A Scenic library defining classes, regions, actions, helper functions, etc. for use by scenarios targeting a particular simulator or application domain. For example, the world model for the Driving Domain,
scenic.domains.driving.model, defines classes for vehicles, actions for steering, and regions for different parts of the road network. In the line
Car in intersection, only the
inspecifier is built into Scenic: the class
Carand the region
intersectionare defined by the world model. A world model can be used through the
modelstatement, or simply by importing it like any other Scenic module.
Defining a World Model gives further examples and details on how to write a world model.