Traffic

Traffic Behavior (beTraffic) makes an entity present on the traffic system. Its parameters define vehicle properties (size, speeds and accelerations). 

Traffic behavior in the behavior editor

For more information on traffic in Golaem Crowd, see Traffic Locator & Traffic tutorial

To use a Traffic Behavior, a Traffic Locator is mandatory. A Traffic Behavior uses the Traffic Locator attached to its related CrowdField.

To define a goal for the car, see Traffic Goto.  Without Traffic Goto, the entity will stay still.

The car size in the simulation is the bounding box of the Perception Shape, which is defined in the Character Maker and can be overridden with any geometry in the Entity Type node Perception Attributes

When started, the entity is moved to the closest position on lanes, and its orientation is matched to the chosen lane. By default, it will be adapted on the ground if available, or it will be placed on the matching curve height if there is no ground, or if there is no adaptation asked. 

CREATION

  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBe Traffic Node
  • MEL command: glmCrowdBeTrafficCmd;

CONFIGURATION

A Traffic Behavior defines the following specific attributes. For common attributes, see Behavior Common Attributes.

Static configuration of a car

Here is the static configuration of a car, LN stands for lateral noise, Pivot Per for Pivot Percent (defined in the Entity Type Traffic attributes), SD for Safety Distance, Len for Length and Wdh for Width (the width and the length, according to the front axis, of bounding box of the Perception Shape, which is defined in the Character Maker and can be overridden with any geometry in the Entity Type node Perception Attributes). 

 

To check if a car is configured correctly, run the simulation and select it, then activate Car Box in the visual feedback. It will display a blue box around the car, as in the image above. The safety distance is a ratio applied to the length of the car, it represents the static safety distance that a car keeps when stopping.

The lateral noise uses the free space in the lane width, to add a lateral offset to the car. If the noise is set to 1, the car can be placed anywhere from the center of the lane, up to touching the lane side. If the noise is 0.5, only the half of the space from the lane center can be used for the lateral offset. Note that if the lane width equals the car width, there will be no lateral offset.

Traffic Attributes

A vehicle is defined by its size (length & width in meters) in its EntityType. It also has acceleration / deceleration properties and speed limits.

All the speeds and acceleration parameters can be multiplied by a random ratio, provided as min/max limits or ppAttributes.

Max Speed

Maximum speed that the car can reach in optimal conditions (sufficient time with no obstacle)

Speed When Turning

This is the speed the car should adopt when turning on a sharp turn (the car adapts its speed when the road is more curvy)

Max Acceleration

The maximum acceleration that the car should respect (m.s-2)

Max Deceleration

The maximum deceleration that the car should respect when braking (m.s-2)

Max Angular Speed

When the car should turn from a big amount at once, this parameter insures that the car is not exceeding this angular speed (degrees per second), else it will span the change on several frames.

Speeds Ratio Mode

Speeds and accelerations multiplier mode : Random, Per-Particle Attribute or Golaem Attribute. If no randomization is desired, just set min & max to the same value

Speeds Ratio Min

Minimum bound of random speeds and accelerations ratio (in Random Speeds Ratio Mode)

Speeds Ratio Max

Maximum bound of random speeds and accelerations ratio (in Random Speeds Ratio Mode)

Speeds Ratio Attr

The name of the Per-Particle Attribute or Golaem Attribute, in Per-Particle Attribute or Golaem Attribute Speeds Ratio Mode

Lateral Noise Scope The lateral noise is picked randomly, either once for the whole simulation, or each time the car reaches a new lane
Lateral Noise Mode

Lateral Noise mode: Random, Per-Particle Attribute or Golaem Attribute. If no randomization is desired, just set min & max to the same value

Lateral Noise Min

Minimum bound of random Lateral Noise (in Random Lateral Noise Mode)

Lateral Noise Max

Maximum bound of random Lateral Noise (in Random Lateral Noise Mode)

Lateral Noise Attr

The name of the Per-Particle Attribute or Golaem Attribute, in Per-Particle Attribute or Golaem Attribute Lateral Noise Mode

Safety Distance Mode

Safety Distance mode: Random, Per-Particle Attribute or Golaem Attribute. If no randomization is desired, just set min & max to the same value

Safety Distance Min

Minimum bound of random Safety Distance (in Random Safety Distance Mode)

Safety Distance Max

Maximum bound of random Safety Distance (in Random Safety Distance Mode)

Safety Distance Attr

The name of the Per-Particle Attribute or Golaem Attribute, in Per-Particle Attribute or Golaem Attribute Safety Distance Mode