Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Friends | List of all members
ORCA::Agent Class Reference

Defines an agent in the simulation. More...

#include <ORCAAgent.h>

Inheritance diagram for ORCA::Agent:
Menge::Agents::BaseAgent Menge::Agents::ProximityQuery

Public Member Functions

 Agent ()
 Constructor.
 
 ~Agent ()
 Destroys this agent instance.
 
void computeNewVelocity ()
 Computes the new velocity of this agent.
 
size_t computeORCALines ()
 Based on the neighbors, computes the ORCA lines. More...
 
- Public Member Functions inherited from Menge::Agents::BaseAgent
 BaseAgent ()
 Default constructor.
 
void initialize ()
 Initializes the agent.
 
void update (float timeStep)
 Updates the two-dimensional position and two-dimensional velocity of this agent. More...
 
void computeNewVelocity ()
 Given preferred velocity and neighboring agents and obstacles compute a new velocity. More...
 
const BaseAgentgetNeighbor (int idx) const
 Returns a pointer to the neighbor with given index. More...
 
const ObstaclegetObstacle (int idx) const
 Returns a pointer to the obstacle with given index. More...
 
void setPreferredVelocity (PrefVelocity &velocity)
 set the agents preferred velocity to the input velocity. More...
 
void addVelModifier (BFSM::VelModifier *v)
 Add an velocity modifier to the agent. More...
 
void insertAgentNeighbor (const BaseAgent *agent, float distSq)
 Inserts an agent neighbor into the set of neighbors of this agent. More...
 
void insertObstacleNeighbor (const Obstacle *obstacle, float distSq)
 Inserts a static obstacle neighbor into the set of neighbors of this agent. More...
 
virtual void setStrideParameters (float stride, float buffer)
 Sets the density sensitivity parameters. More...
 
virtual void startQuery ()
 clears the result vectors. Resets the filter
 
virtual void filterAgent (const BaseAgent *agent, float distance)
 filters an agent and determines if it needs to be in the near set More...
 
virtual void filterObstacle (const Obstacle *, float distance)
 filters an obstacle and determines if it needs to be in the near set More...
 
virtual Vector2 getQueryPoint ()
 gets the start point for the query More...
 
virtual float getMaxAgentRange ()
 updates the max agent query range if conditions inside the filter are met typically, we don't shrink the query range until the result set is full More...
 
virtual float getMaxObstacleRange ()
 updates the max query obstacle range if conditions inside the filter are met typically, we don't shrink the query range until the result set is full More...
 
- Public Member Functions inherited from Menge::Agents::ProximityQuery
 ProximityQuery ()
 default Constructor.
 

Public Attributes

std::vector< Menge::Math::Line_orcaLines
 The set of ORCA constraints.
 
float _timeHorizon
 The time horizon for inter-agent interactions.
 
float _timeHorizonObst
 The time horizon for agent-obstacle interactions.
 
- Public Attributes inherited from Menge::Agents::BaseAgent
float _maxSpeed
 The maximum speed the agent can take.
 
float _maxAccel
 The maximum acceleration the agent can experience (interpreted isotropically).
 
float _prefSpeed
 The preferred speed of the agent.
 
Vector2 _pos
 The current 2D position of the agent.
 
Vector2 _vel
 The current 2D velocity of the agent.
 
PrefVelocity _velPref
 The 2D preferred velocity of the agent.
 
Vector2 _velNew
 The new velocity computed in computeNewVelocity. More...
 
Vector2 _orient
 The orientation vector (the direction the agent is facing which is not necessarily the same direction as the instantaneous velocity. More...
 
float _maxAngVel
 The agent's maximum angular velocity (in radians/sec) – used for controlling the changes in agent orientation.
 
size_t _maxNeighbors
 The number of nearby agents used to plan dynamic respones.
 
float _neighborDist
 The maximum distance at which another agent will be considered for a response.
 
size_t _class
 The population class for this agent. More...
 
size_t _obstacleSet
 A mask indicating the obstacles with compatible ids which this agent can see. More...
 
float _priority
 The priority of each agent. More...
 
size_t _id
 A globally unique identifier for each agent.
 
float _radius
 The agent's radius. More...
 
std::vector< BFSM::VelModifier * > _velModifiers
 a set of velocity modifiers to be set with the agent. Allows for intermediate velocity changes
 
std::vector< NearAgent_nearAgents
 The nearby agents to which the agent should respond. More...
 
std::vector< NearObstacle_nearObstacles
 The nearby obstacles to which the agent should respond. More...
 

Static Public Attributes

static const float TAU = 2.5f
 The default time horizon for inter-agent interactions. More...
 
static const float TAU_OBST = 0.15f
 The default time horizon for agent-obstacle interactions. More...
 

Protected Member Functions

void obstacleLine (size_t obstNbrID, const float invTau, bool flip)
 Constructs an ORCA line for the given obstacle under the assumption that the agent is on its right side. If appropriate, it adds the obstacle to the set of orca lines. More...
 
- Protected Member Functions inherited from Menge::Agents::ProximityQuery
virtual ~ProximityQuery ()
 Virtual destructor.
 

Friends

class Simulator
 

Detailed Description

Defines an agent in the simulation.

Member Function Documentation

size_t ORCA::Agent::computeORCALines ( )

Based on the neighbors, computes the ORCA lines.

Returns
The total number of obstacle lines
void ORCA::Agent::obstacleLine ( size_t  obstNbrID,
const float  invTau,
bool  flip 
)
protected

Constructs an ORCA line for the given obstacle under the assumption that the agent is on its right side. If appropriate, it adds the obstacle to the set of orca lines.

Parameters
obstNbrIDThe index of the near-by obstacle to test.
invTau1 / _timeHorizonObst - the inverse of the time horizon for obstacles.
flipThe agent is on the left side of this obstacle.

These booleans short-cut the later code in which we make sure a leg direction does not cut into a "neighboring" obstacle.

In the case where the agent is "obliquely viewing" the obstacle near the left or right edge, we end up testing one of the legs against obstacle 1 itself. However, by definition, we know that both legs lie outside of the obstacle.

Member Data Documentation

const float ORCA::Agent::TAU = 2.5f
static

The default time horizon for inter-agent interactions.

The default value for tau (the time horizon w.r.t. other agents).

const float ORCA::Agent::TAU_OBST = 0.15f
static

The default time horizon for agent-obstacle interactions.

The default value for tau obstacles (the time horizon w.r.t. obstacles).


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