Social Forces# class Potential# A monotonic decreasing function of the distance __call__(x: float) → tuple[float, Vector2]# Returns the value and gradient of the potential Parameters: x – The distance Returns: (value, gradient) class ExponentialPotential# A potential of form \(V(x) = a e^{-\frac{x}{r}}\) __init__(a: float, r: float)# Constructs a new instance. Parameters: a – The amplitude r – The scale class SocialForceBehavior# Bases: Behavior Basic social force algorithm from Helbing, Dirk, and Peter Molnar. “Social force model for pedestrian dynamics.” Physical review E 51.5 (1995): 4282. Registered properties: tau [float] phi [float] c [float] u_a [float] u_r [float] v_a [float] v_r [float] step_duration [float] State: GeometricState __init__(kinematics: Kinematics | None = None, radius: float = 0.0, tau: float = 0.5, step_duration: float = 1.0, phi: float = 1.75, c: float = 0.5, v: Potential | None = None, u: Potential | None = None)# Constructs a new instance. Parameters: kinematics – The kinematics radius – The radius tau – The tau step_duration – The step duration phi – The phi c – The weight of ‘non-in-sight’ forces v – The neighbor potential. Will use default if not set. u – The obstacle potential. Will use default if not set. desired_velocity_towards_point(point: Vector2Like, speed: SupportsFloat, time_step: SupportsFloat) → Vector2# Overridden: computes an optimal target velocity and calls desired_velocity_towards_velocity(). Parameters: point – The point speed – The speed time_step – The time step Returns: The desired velocity desired_velocity_towards_velocity(target_velocity: Vector2Like, time_step: SupportsFloat) → Vector2# Overridden: applies social forces to deviate from target velocity. Parameters: target_velocity – The target velocity time_step – The time step Returns: The desired velocity get_environment_state() → GeometricState# Overridden to define a GeometricState. Returns: The environment state. property c: float# The weight of ‘non-in-sight’ forces property phi: float# The field of sight half-length property step_duration: float# The duration of a step [s]. property tau: float# The relaxation time [s]. property u_a: float# The obstacles potential amplitude property u_r: float# The obstacles potential length scale property v_a: float# The neighbors potential amplitude property v_r: float# The neighbors potential length scale
Social Forces#
A monotonic decreasing function of the distance
Returns the value and gradient of the potential
x – The distance
(value, gradient)A potential of form \(V(x) = a e^{-\frac{x}{r}}\)
Constructs a new instance.
a – The amplitude
r – The scale
Bases:
BehaviorBasic social force algorithm from
Registered properties:
tau[float]phi[float]c[float]u_a[float]u_r[float]v_a[float]v_r[float]step_duration[float]State:
GeometricStateConstructs a new instance.
kinematics – The kinematics
radius – The radius
tau – The tau
step_duration – The step duration
phi – The phi
c – The weight of ‘non-in-sight’ forces
v – The neighbor potential. Will use default if not set.
u – The obstacle potential. Will use default if not set.
Overridden: computes an optimal target velocity and calls
desired_velocity_towards_velocity().point – The point
speed – The speed
time_step – The time step
The desired velocity
Overridden: applies social forces to deviate from target velocity.
target_velocity – The target velocity
time_step – The time step
The desired velocity
Overridden to define a
GeometricState.The environment state.
The weight of ‘non-in-sight’ forces
The field of sight half-length
The duration of a step [s].
The relaxation time [s].
The obstacles potential amplitude
The obstacles potential length scale
The neighbors potential amplitude
The neighbors potential length scale