Menge Plugin Examples
A Collection of Example Plugins for the Menge Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
AircraftTransition.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 __AIRLINE_TRANSITION_H__
45 #define __AIRLINE_TRANSITION_H__
46 
47 #include "AircraftConfig.h"
48 #include "Transitions/Condition.h"
50 #include "FSMEnumeration.h"
51 #include "Math/Geometry2D.h"
52 #include <map>
53 
54 using namespace Menge;
55 
56 //forward declaration
57 class TiXmlElement;
58 
59 namespace Aircraft {
60  // forward declaration
61  class ClearAABBCondFactory;
62 
67  class EXPORT_API ClearAABBCondition : public BFSM::Condition {
68  public:
72  ClearAABBCondition(): BFSM::Condition(), _relative(false), _agentClass(-1), _baseBox(){} // -1 is maximum agent class value
73 
79  ClearAABBCondition( const ClearAABBCondition & cond );
80 
81  protected:
85  virtual ~ClearAABBCondition();
86 
87  public:
95  virtual bool conditionMet( Agents::BaseAgent * agent, const BFSM::Goal * goal );
96 
105  virtual BFSM::Condition * copy();
106 
107  friend class ClearAABBCondFactory;
108 
121  void setParams(float xMin, float xMax, float yMin, float yMax, bool relative, int agentClass);
122 
123  protected:
127  bool _relative;
128 
133  size_t _agentClass;
134 
138  AABBShape _baseBox;
139  };
140 
144  class EXPORT_API ClearAABBCondFactory : public BFSM::ConditionFactory {
145  public:
154  const char * name() const { return "clear_AABB"; }
155 
163  const char * description() const {
164  return "The clear axis-aligned bounding box (AABB) condition. It becomes active when no agents are in a box "\
165  "defined in either an absolute position, or relative to the agent.";
166  }
167 
168  protected:
179  ClearAABBCondition * instance() const { return new ClearAABBCondition(); }
180 
199  virtual bool setFromXML( BFSM::Condition * condition, TiXmlElement * node, const std::string & behaveFldr ) const;
200  };
201 
202 } // namespace Aircraft
203 
204 #endif // __AIRCRAFT_ACTION_H__
const char * description() const
A description of the action.
Definition: AircraftTransition.h:163
ClearAABBCondition()
Constructor.
Definition: AircraftTransition.h:72
An action that sets agent properties based on the agent's position along the x-axis.
Definition: AircraftTransition.h:67
size_t _agentClass
The agent class this transition operates on. If -1, all agent classes are tested. ...
Definition: AircraftTransition.h:133
The namespace containing Menge elements required for simulating aircraft loading and unloading...
Definition: AircraftAction.cpp:47
Configures the shared library aspect of the includes.
bool _relative
Indicates whether the box is defined relative to the agent's position (true) or not (false)...
Definition: AircraftTransition.h:127
const char * name() const
The name of the action.
Definition: AircraftTransition.h:154
AABBShape _baseBox
The definition of the underlying AABB.
Definition: AircraftTransition.h:138
The factory for creating the ClearAABBCondition.
Definition: AircraftTransition.h:144
ClearAABBCondition * instance() const
Create an instance of this class's condition.
Definition: AircraftTransition.h:179