scenic.core.object_types

Implementations of the built-in Scenic classes.

Summary of Module Members

Functions

disableDynamicProxyFor

enableDynamicProxyFor

setDynamicProxyFor

Classes

HeadingMutator

Mutator adding Gaussian noise to heading.

Mutator

An object controlling how the mutate statement affects an Object.

Object

Implementation of the Scenic class Object.

OrientedPoint

Implementation of the Scenic class OrientedPoint.

Point

Implementation of the Scenic base class Point.

PositionMutator

Mutator adding Gaussian noise to position.

Member Details

class Mutator[source]

An object controlling how the mutate statement affects an Object.

A Mutator can be assigned to the mutator property of an Object to control the effect of the mutate statement. When mutation is enabled for such an object using that statement, the mutator’s appliedTo method is called to compute a mutated version.

appliedTo(obj)[source]

Return a mutated copy of the object. Implemented by subclasses.

class PositionMutator(stddev)[source]

Bases: scenic.core.object_types.Mutator

Mutator adding Gaussian noise to position. Used by Point.

Attributes

stddev (float) – standard deviation of noise

class HeadingMutator(stddev)[source]

Bases: scenic.core.object_types.Mutator

Mutator adding Gaussian noise to heading. Used by OrientedPoint.

Attributes

stddev (float) – standard deviation of noise

class Point(<specifiers>)[source]

Implementation of the Scenic base class Point.

The default mutator for Point adds Gaussian noise to position with a standard deviation given by the positionStdDev property.

Properties
  • position (Vector; dynamic) – Position of the point. Default value is the origin.

  • visibleDistance (float) – Distance for can see operator. Default value 50.

  • width (float) – Default value zero (only provided for compatibility with operators that expect an Object).

  • length (float) – Default value zero.

Note

If you’re looking into Scenic’s internals, note that Point is actually a subclass of the internal Python class _Constructible.

class OrientedPoint(<specifiers>)[source]

Bases: scenic.core.object_types.Point

Implementation of the Scenic class OrientedPoint.

The default mutator for OrientedPoint adds Gaussian noise to heading with a standard deviation given by the headingStdDev property, then applies the mutator for Point.

Properties
  • heading (float; dynamic) – Heading of the OrientedPoint. Default value 0 (North).

  • viewAngle (float) – View cone angle for can see operator. Default value \(2\pi\).

class Object(<specifiers>)[source]

Bases: scenic.core.object_types.OrientedPoint

Implementation of the Scenic class Object.

This is the default base class for Scenic classes.

Properties
  • width (float) – Width of the object, i.e. extent along its X axis. Default value 1.

  • length (float) – Length of the object, i.e. extent along its Y axis. Default value 1.

  • allowCollisions (bool) – Whether the object is allowed to intersect other objects. Default value False.

  • requireVisible (bool) – Whether the object is required to be visible from the ego object. Default value True.

  • regionContainedIn (Region or None) – A Region the object is required to be contained in. If None, the object need only be contained in the scenario’s workspace.

  • cameraOffset (Vector) – Position of the camera for the can see operator, relative to the object’s position. Default 0 @ 0.

  • speed (float; dynamic) – Speed in dynamic simulations. Default value 0.

  • velocity (Vector; dynamic) – Velocity in dynamic simulations. Default value is the velocity determined by self.speed and self.heading.

  • angularSpeed (float; *dynamic*) – Angular speed in dynamic simulations. Default value 0.

  • behavior – Behavior for dynamic agents, if any (see Dynamic Scenarios). Default value None.

startDynamicSimulation()[source]

Hook called at the beginning of each dynamic simulation.

Does nothing by default; provided for objects to do simulator-specific initialization as needed.

class _Constructible(*args, _internal=False, **kwargs)[source]

Bases: scenic.core.distributions.Samplable

Abstract base class for Scenic objects.

Scenic objects, which are constructed using specifiers, are implemented internally as instances of ordinary Python classes. This abstract class implements the procedure to resolve specifiers and determine values for the properties of an object, as well as several common methods supported by objects.