src.utils.get_force_map module#
- src.utils.get_force_map.get_force_map(r=10, A=3.0, B=0.6, device='cpu')[source]#
Generate a local repulsive force-field template for the Social Force Model.
Compute a radial repulsive force field centered at the origin, used to model repulsion between obstacles or pedestrians. The result is cached with LRU Cache to avoid repeated computation.
- Parameters:
r (int, optional) – Radius (half side length) of the force field. The grid size is (2r+1)x(2r+1). Default is 10.
A (float, optional) – Strength coefficient of the repulsive force. Default is 3.0.
B (float, optional) – Decay range coefficient of the repulsive force. Default is 0.6.
device (str, optional) – Device on which the tensor is stored. Default is ‘cpu’.
- Returns:
- Generated force-field vector map.
Shape: (2r+1, 2r+1, 2), where the last dimension is (fx, fy).
- Return type:
torch.Tensor