Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AgentGenerator.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 __AGENT_GENERATOR_H__
45 #define __AGENT_GENERATOR_H__
46 
47 #include "mengeCommon.h"
48 #include "Element.h"
49 
50 namespace Menge {
51 
52  namespace Math {
53  class FloatGenerator;
54  }
55 
56  namespace Agents {
57  // forward declaration
58  class BaseAgent;
59 
63  class MENGE_API AgentGeneratorException : public virtual MengeException {
64  public:
69 
75  AgentGeneratorException( const std::string & s ): MengeException(s) {}
76  };
77 
82  public:
87 
94  };
95 
104  class MENGE_API AgentGenerator : public Element {
105  public:
109  AgentGenerator();
110 
111  protected:
115  virtual ~AgentGenerator();
116 
117  public:
123  virtual size_t agentCount() = 0;
124 
132  virtual Vector2 agentPos( size_t i ) = 0;
133 
142  void setNoiseGenerator( Math::FloatGenerator * gen );
143 
150  Vector2 addNoise( const Vector2 & pos );
151 
152  protected:
157 
162  };
163 
164  } // namespace Agents
165 } // namespace Menge
166 #endif // __AGENT_GENERATOR_H__
AgentGeneratorFatalException(const std::string &s)
Constructor with message.
Definition: AgentGenerator.h:93
Math::FloatGenerator * _dir
The generator for angular displacement.
Definition: AgentGenerator.h:161
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
Generic abstract class which generates a scalar float value.
Definition: RandGenerator.h:99
The base class inital agent generation.
Definition: AgentGenerator.h:104
Base class for all Menge elements.
AgentGeneratorException()
Default constructor.
Definition: AgentGenerator.h:68
The basic interface of extendible Menge Elements.
Definition: Element.h:67
AgentGeneratorFatalException()
Default constructor.
Definition: AgentGenerator.h:86
Base exception class for menge operations.
Definition: MengeException.h:58
The namespace for math primitives for simulation and visualization.
Base class for fatal exceptions.
Definition: MengeException.h:99
Math::FloatGenerator * _disp
The generator for displacement amount (defaults to zero).
Definition: AgentGenerator.h:156
The namespace that contains the basic simulation mechanisms.
Exception class for agent generator computation.
Definition: AgentGenerator.h:63
The fatal agent generator exception.
Definition: AgentGenerator.h:81
AgentGeneratorException(const std::string &s)
Constructor with message.
Definition: AgentGenerator.h:75