All Classes Namespaces Files Functions Variables Typedefs Pages
Protected Member Functions | Protected Attributes | List of all members
TTC::Agent Class Reference

Simulates the anticipatory behavior of an agent. More...

#include <Agent.h>

Inherits TTC::ProximityDatabaseItem.

Public Member Functions

Agent functionality
bool isAgent ()
 Returns true if the object is an agent, false if not.
 
bool enabled () const
 Returns true if the agent is active.
 
Vector2D position () const
 Returns the position of the agent.
 
Vector2D velocity () const
 Returns the velocity of the agent.
 
Vector2D goal () const
 Returns the goals of the agent.
 
Vector2D vPref () const
 Returns the preferred velocity of the agent.
 
float prefSpeed () const
 Returns the preferred speed of the agent.
 
float maxAccel () const
 Returns the maximum acceleration of the agent.
 
float radius () const
 Returns the radius of the agent.
 
int id () const
 Returns the id of the agent.
 
void setPreferredVelocity (const Vector2D &vPref)
 Sets the preferred velocity of the agent to a specific value. More...
 
- Public Member Functions inherited from TTC::ProximityDatabaseItem
virtual ~ProximityDatabaseItem ()
 Destructor.
 

Protected Member Functions

void computeNeighbors ()
 Computes the neighbors which will be considered for computing the anticipatory forces.
 
void computeForces ()
 Computes the forces exerted on the agent at each simulation step. More...
 
void destroy ()
 Destroy the agent.
 

Protected Attributes

Vector2D _vPref
 the preferred velocity of the character
 
bool _enabled
 Determine whether the charater is enabled;.
 
Vector2D _position
 The position of the character.
 
Vector2D _goal
 The goal of the character.
 
Vector2D _velocity
 The velocity of the character.
 
float _radius
 The radius of the character.
 
int _id
 The id of the character.
 
float _prefSpeed
 The preferred speed of the character.
 
float _maxAccel
 The maximum acceleration of the character.
 
float _goalRadiusSq
 The goal radius of the character.
 
ProximityToken_proximityToken
 a pointer to this interface object for the proximity database
 
std::vector
< ProximityDatabaseItem * > 
_proximityNeighbors
 The proximity neighbors.
 
float _neighborDist
 The maximum distance from the agent at which an object will be considered.
 
Vector2D _F
 The final force acting on the agent.
 
float _k
 The scaling constant k of the anticipatory law.
 
float _t0
 The exponential cutoff term tau_0.
 
float _m
 The exponent of the power law (m = 2 in our analysis)
 
float _ksi
 Relaxation time for the driving force.
 

Detailed Description

Simulates the anticipatory behavior of an agent.

Member Function Documentation

void TTC::Agent::computeForces ( )
inlineprotected

Computes the forces exerted on the agent at each simulation step.

Our simulation model includes the following three forces:

  • A driving force \(\mathbf{F}_i\) indicating the preference of the agent \(i\) to walk in a certain direction at a certain speed, as defined in [D. Helbing, I. Farkas, and T. Vicsek, Nature 407, 487 (2000)], \( \mathbf{F}_{i} = \frac{\mathbf{v}^{pref}_{i}-\mathbf{v}_{i}}{\xi}\). This force can be replaced by a self-propelled force to simulate agents with no preferred direction of motion following the approach of [D. Grossman, I. S. Aranson, and E. B. Jacob, New J. Phys. 10, 023036 (2008).]
  • The agent-agent interaction force \(\mathbf{F}_{ij}\) derived in Eq. (S2) of the Supplemental material.
  • A similar force \(\mathbf{F}_{iO}\) acting on agent \(i\) as a result of interaction with each static obstacle O present in the environment. In our simulations, we generally assume that obstacles are modeled as a collection of line segments. Then, \(\mathbf{F}_{iO} = -\nabla_{\mathbf{r}}\left( k\tau^{-2}e^{-\tau/\tau_0} \right)\), but now \(\tau\) denotes the minimal intersection time between the ray \(\mathbf{x}_{i} + t\mathbf{v}_{i}, t >0 \) and the 2D capsule resulting after sweeping \(O\) with the disc of the agent.
void TTC::Agent::setPreferredVelocity ( const Vector2D vPref)
inline

Sets the preferred velocity of the agent to a specific value.

Parameters
vprefThe new preferred velocity of the agent

The documentation for this class was generated from the following files: