Behaviour Layer

This layer of the SP model controls the decision making processes of the simulated pedestrians. Specifically, it is responsible for selecting an appropriate maneuver to be executed by the pedestrian at each simulation time step. This process uses Behaviour Trees as a control architecture to determine a maneuver based on a set of predefined conditions. For information on the node structure and Domain-Specific Language (DSL) used to construct behaviour trees, see the vehicle Behaviour Layer page.

Condition Nodes

Condition nodes are used to guide the decision made by the behaviour tree given the current environmental context. Each node contains a Boolean condition linked to an evaluation function in the model that provides information about the current context.

Below are examples of condition function implemented in the current version of the model. This list can be expanded by future users to fit their scenario requirements.

Note: In the table below, target crosswalk refers to a crosswalk that the pedestrian has already decided to take but has not necessarily entered or crossed it yet.

Condition Attributes Description
Reached goal threshold_distance (m) True if pedestrian is within the threshold_distance
from its goal point
Has target crosswalk - True if pedestrian has selected a target crosswalk
Approaching target crosswalk threshold_distance (m) True if pedestrian is within the threshold_distance
from its target crosswalk entrance point
At target crosswalk entrance/exit
(two separate conditions)
threshold_distance (m) True if pedestrian is within the threshold_distance
from its target crosswalk entrance/exit point
Waiting at target crosswalk entrance - True if pedestrian is at target crosswalk entrance
but must wait to enter (due to light or obstruction)
Target crosswalk has signal - True if the target crosswalk has a crossing signal
Crossing signal is green/red/yellow
(three separate conditions)
- True if the crossing signal for the target crosswalk
is green/red/yellow
Can cross before crossing light turns red speed_increase_% (s)
distance_from_exit (m)
True if the pedestrian can reach a point in the crosswalk
within distance_from_exit from the exit with a speed_increase_%
of their current speed. In Equation 1, this condition is true if
ttoCross is less than or equal to the time to the next red light.
Vehicle approaching crosswalk threshold_distance (m) True if there is a vehicle in motion approaching
(within threshold_distance from) the pedestrian's target crosswalk

Equation 1

dentry is the distance from the pedestrian's position to the crosswalk entrance
dxwalk is the distance between the crosswalk's entrance and exit
dfromExit is the acceptable distance_from_exit to be considered fully crossed
s is the pedestrian's desired walking speed
k is the speed_increase_%

Maneuver Nodes

Maneuver nodes contain actions the pedestrian can execute. The pedestrian's behaviour tree selects an appropriate maneuver to be executed at each simulation time step. The main properties affected by a maneuver are the current waypoint, the desired speed, and the walking direction unit vector (which does not necessarily point to the waypoint).

Below is a list of currently implemented maneuvers. As with the conditions, this list is not exhaustive and may be extended to fit the scenario requirements.

Maneuver Description
Keep in Lane Walk towards current waypoint following
the general shape of the occupied lanelet
Stop Set desired walking speed to 0
Enter Crosswalk Update waypoint to be the crosswalk's exit point
Exit Crosswalk Run Waypoint Selection Algorithm to determine
next waypoint (dependent on goal point and road structure)
Wait at Crosswalk Pedestrian has already chosen to take the crosswalk
but cannot enter yet. Waypoint is still the crosswalk
entrance point until pedestrian executes Enter Crosswalk.
Select Crosswalk by Light State Pedestrian decides which crosswalk to take, possibly
given multiple candidates. Factors in the decision include
the goal point (to determine the list of candidates),
the pedestrian's level of aggressiveness,
and the current light states of candidate crosswalks.

Once a maneuver is selected by the behaviour tree, it is passed to the model's lower layers (Maneuver Layer and Motion Planner layer) for processing. The Maneuver layer translates the selected maneuver into low-level instructions to feed into the Social Force model component of the Motion Planner layer. The Motion Planner layer receives these instructions, runs an iteration of the Social Force model, and outputs the pedestrian's next state vector. The model then directly updates the pedestrian's new state information in the environment for the next simulation cycle.