Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ORCAAgent.h
Go to the documentation of this file.
1 /*
2 
3 License
4 
5 Menge
6 Copyright © and trademark ™ 2012-14 University of North Carolina at Chapel Hill.
7 All rights reserved.
8 
9 Permission to use, copy, modify, and distribute this software and its documentation
10 for educational, research, and non-profit purposes, without fee, and without a
11 written agreement is hereby granted, provided that the above copyright notice,
12 this paragraph, and the following four paragraphs appear in all copies.
13 
14 This software program and documentation are copyrighted by the University of North
15 Carolina at Chapel Hill. The software program and documentation are supplied "as is,"
16 without any accompanying services from the University of North Carolina at Chapel
17 Hill or the authors. The University of North Carolina at Chapel Hill and the
18 authors do not warrant that the operation of the program will be uninterrupted
19 or error-free. The end-user understands that the program was developed for research
20 purposes and is advised not to rely exclusively on the program for any reason.
21 
22 IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS
23 BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
24 DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
25 DOCUMENTATION, EVEN IF THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE
26 AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY
29 DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
30 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY STATUTORY WARRANTY
31 OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
32 THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS HAVE NO OBLIGATIONS
33 TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
34 
35 Any questions or comments should be sent to the authors {menge,geom}@cs.unc.edu
36 
37 */
38 
44 #ifndef __ORCA_AGENT_H__
45 #define __ORCA_AGENT_H__
46 
47 #include "BaseAgent.h"
48 #include "Math/Line.h"
49 
50 namespace ORCA {
55  public:
59  Agent();
60 
64  ~Agent();
65 
69  void computeNewVelocity();
70 
76  size_t computeORCALines();
77 
81  std::vector<Menge::Math::Line> _orcaLines;
82 
86  float _timeHorizon;
87 
92 
93  // DEFAULT VALUES FOR THE AGENT PARAMTERS
97  static const float TAU;
98 
102  static const float TAU_OBST;
103 
104  friend class Simulator;
105 
106  protected:
117  void obstacleLine( size_t obstNbrID, const float invTau, bool flip );
118  };
119 
133  bool linearProgram1(const std::vector<Menge::Math::Line>& lines, size_t lineNo,
134  float radius, const Vector2& optVelocity,
135  bool directionOpt, Vector2& result);
136 
148  size_t linearProgram2(const std::vector<Menge::Math::Line>& lines, float radius,
149  const Vector2& optVelocity, bool directionOpt,
150  Vector2& result);
151 
162  void linearProgram3(const std::vector<Menge::Math::Line>& lines, size_t numObstLines, size_t beginLine,
163  float radius, Vector2& result);
164 } // namespace ORCA
165 
166 #endif
void computeNewVelocity()
Computes the new velocity of this agent.
Definition: ORCAAgent.cpp:381
static const float TAU
The default time horizon for inter-agent interactions.
Definition: ORCAAgent.h:97
size_t linearProgram2(const std::vector< Menge::Math::Line > &lines, float radius, const Vector2 &optVelocity, bool directionOpt, Vector2 &result)
Solves a two-dimensional linear program subject to linear constraints defined by lines and a circular...
Definition: ORCAAgent.cpp:463
size_t computeORCALines()
Based on the neighbors, computes the ORCA lines.
Definition: ORCAAgent.cpp:292
Templated vector in R2.
Definition: Vector2.h:76
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 si...
Definition: ORCAAgent.cpp:70
float _timeHorizon
The time horizon for inter-agent interactions.
Definition: ORCAAgent.h:86
Contains the definition for an line used as a linear constraint (e.g. ORCA half plane) ...
Agent()
Constructor.
Definition: ORCAAgent.cpp:58
std::vector< Menge::Math::Line > _orcaLines
The set of ORCA constraints.
Definition: ORCAAgent.h:81
bool linearProgram1(const std::vector< Menge::Math::Line > &lines, size_t lineNo, float radius, const Vector2 &optVelocity, bool directionOpt, Vector2 &result)
Solves a one-dimensional linear program on a specified line subject to linear constraints defined by ...
Definition: ORCAAgent.cpp:395
The namespace for the ORCA local collision avoidance model.
Definition: ORCAAgent.cpp:46
Contains the BaseAgent class - the underlying class which defines the basic functionality for all sha...
Defines the simulator operating on ORCA::Agent.
Definition: ORCASimulator.h:59
Defines the basic agent properties and functionality that all simulation agents share.
Definition: BaseAgent.h:123
static const float TAU_OBST
The default time horizon for agent-obstacle interactions.
Definition: ORCAAgent.h:102
float _timeHorizonObst
The time horizon for agent-obstacle interactions.
Definition: ORCAAgent.h:91
~Agent()
Destroys this agent instance.
Definition: ORCAAgent.cpp:65
void linearProgram3(const std::vector< Menge::Math::Line > &lines, size_t numObstLines, size_t beginLine, float radius, Vector2 &result)
Solves a two-dimensional linear program subject to linear constraints defined by lines and a circular...
Definition: ORCAAgent.cpp:494
Defines an agent in the simulation.
Definition: ORCAAgent.h:54