Skip to content

Foretify's SUMO Behavioral Model Engine

By default, NPCs that use Foretify's SUMO Behavioral Model Engine (BME) are configured to avoid collisions of any kind. Each NPC runs its own collision avoidance mechanism, and its decisions do not rely on another NPC's collision behavior.

If physically possible, the NPC avoids any obstacle, from static parked vehicles and boulders to moving vehicles and walking pedestrians. Currently, NPCs avoid collisions in this manner:

  • For obstacles in front of the NPC, use of the brake pedal adapts the driving speed and avoids getting closer to the obstacle.
  • For obstacles to the side of the NPC, use of the steering wheel prevents lane changes into occupied lanes.

The following fields of vehicle.policy configure how the collision avoidance mechanism is applied.

Field name Type Description Default constraint
ca_activation_TTC time Time To Collision below which collision avoidance mechanism intervenes. 2000ms
ca_aggressiveness int The aggressiveness with which the collision avoidance intervenes. A higher value causes sooner reach of maximal braking acceleration. 5
ca_safety_distance_lon length At this longitudinal distance, collision avoidance mechanism prevents any additional movement towards an obstacle in front of the NPC. 5meter
ca_safety_distance_lat length At this lateral distance, collision avoidance mechanism prevents any additional movement towards an obstacle at the side of the NPC. 2meter
ca_min_response_time time Fixed time for the NPC to respond to sudden changes in obstacles. 1sec

By default, the collision avoidance behavior is ON but can be turned off for purposes of collision tests or emergency/safety ADAS scenarios.

To turn off the collision avoidance mechanism:

Set the avoid_collisions() modifier to false for each drive it is needed.

OSC2 code: Turn off collision avoidance behavior
car1.cut_in() with:
    avoid_collisions(false)
See avoid_collisions() for more information.

SUMO behavioral models

For the SUMO simulator, Foretify supports the following behavioral models:

  • Krauss: sumo_krauss_driver_model
  • IDM: sumo_idm_driver_model
  • W99: sumo_w99_driver_model

Note

All vehicles implemented by a SUMO driver model are, from Foretify's point of view, autonomous (uncontrolled).

All SUMO-related driver models have the following settings, in addition to model-specific settings:

  • Speed mode settings affect the speed, if an explicit speed is set.
  • Lane change mode settings affect possible lane changes.
  • Miscellaneous settings.

For a complete list of all settings, see SUMO driver model settings.

You can use the models listed above with your own settings, or you can use the parameterized profiles, sumo_idm_normal_driver and sumo_idm_aggressive_driver, provided in $FTX/env/basic/behavioral_models/sumo/common/sumo_demo_profiles.osc.

SUMO driver model settings

Speed settings

Name Description
use_target_speed Use the specified target speed or determine speed based on maximum allowed speed.
target_speed Specifies the target speed. This flag is relevant only if use_target_speed is set to true.
enforce_safe_speed Consider safety when trying to achieve target speed.
enforce_max_acceleration Consider maximum acceleration when trying to achieve target speed.
enforce_max_deceleration Consider maximum deceleration when trying to achieve target speed.
enforce_right_of_way Consider right of way when trying to achieve target speed.
enforce_stop_on_red_light Brake hard to avoid passing a red light.

Lane change settings

Name Description
allow_strategic Allow lane changes to continue route.
strategic_eagerness Specifies the eagerness to perform strategic lane changes. Higher values result in earlier lane-changing (range: 0-inf).
allow_cooperative Allow changes in order to allow other cars to change.
cooperative_willing Specifies the willingness to perform cooperative lane changes. Lower values result in reduced cooperation (range: 0-100).
allow_gain_speed Allow lane changes to gain speed.
speed_gain_eagerness Specifies the eagerness to perform lane changes to gain speed. Higher values result in more lane-changing (range: 0-inf).
allow_drive_on_right Change lane to drive on rightmost lane.
respect_others_safety_gap Respect other cars’ safety gaps when changing lane.
sigma Lateral position imperfection (range: 0-100).

Miscellaneous settings

Name Description
min_standing_gap Minimum gap from next vehicle at 0 speed.
tau The driver's desired (minimum) time headway.

Krauss driver model settings

Name Description
sigma Driver's imperfection (range: 0-100. 0 is perfect driving)

IDM driver model settings

Name Description
delta Acceleration exponent (x10)
stepping Internal step length

W99 driver model settings

Name Description
CC1 Spacing Time
CC2 Following Variation
CC3 Threshold for Entering "Following"
CC4 Negative "Following" Threshold
CC5 Positive "Following" Threshold
CC6 Speed Dependency of Oscillation
CC7 Oscillation Acceleration
CC8 Standstill Acceleration
CC9 Acceleration at 80km/h