Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProjectSpec.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 __PROJECT_SPEC_H__
45 #define __PROJECT_SPEC_H__
46 
47 #include <string>
48 #include <iostream>
49 #include "Logger.h"
50 
51 using namespace Menge;
52 
53 // Forward declaration
54 namespace Menge {
55  class SimulatorDB;
56 }
57 
80 class ProjectSpec {
81 public:
85  ProjectSpec();
86 
87 
91  ~ProjectSpec();
92 
98  std::string getScene() const { return _sceneXML; }
99 
105  std::string getBehavior() const { return _behaviorXML; }
106 
112  std::string getModel() const { return _modelName; }
113 
120  std::string getOutputName() const { return _scbFileName; }
121 
127  std::string getSCBVersion() const { return _scbVersion; }
128 
134  bool getVerbosity() const { return _verbose; }
135 
142  std::string getView() const { return _viewConfig; }
143 
149  int getRandomSeed() const { return _seed; }
150 
156  std::string getDumpPath() const { return _imgDumpPath; }
157 
163  size_t getSubSteps() const { return _subSteps; }
164 
170  float getDuration() const { return _duration; }
171 
178  float getTimeStep() const { return _timeStep; }
179 
190  bool parseCommandParameters( int argc, char* argv[], const SimulatorDB * simDB );
191 
199  bool fullySpecified() const;
200 
208  friend Logger & operator<<( Logger & out, const ProjectSpec & spec );
209 
210 protected:
216  void setOutputName( const std::string & fileName );
217 
229  bool loadFromXML( const std::string & xmlName );
230 
235  std::string _projPath;
236 
240  std::string _sceneXML;
241 
245  std::string _behaviorXML;
246 
250  std::string _modelName;
251 
255  std::string _scbFileName;
256 
260  std::string _scbVersion;
261 
266  bool _verbose;
267 
271  std::string _viewConfig;
272 
276  float _duration;
277 
281  float _timeStep;
282 
286  int _seed;
287 
291  std::string _imgDumpPath;
292 
302  size_t _subSteps;
303 
304 };
305 
306 #endif // __PROJECT_SPEC_H__
std::string getView() const
Get the view specification file.
Definition: ProjectSpec.h:142
float getTimeStep() const
Get the override simulation time step.
Definition: ProjectSpec.h:178
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
Logger & operator<<(Logger &out, const BFSM::PropertyOperand op)
Friend function for printing string versions of the PropertyOperand enum.
Definition: FSMEnumeration.cpp:43
float _duration
The maximum allowable duration of the simulation (in simulation seconds).
Definition: ProjectSpec.h:276
std::string getBehavior() const
Get the beahvior specification file name.
Definition: ProjectSpec.h:105
float getDuration() const
Get the maximum simulation duration.
Definition: ProjectSpec.h:170
std::string _projPath
The path to the project – it is the folder containing the project xml. Defaults to the current worki...
Definition: ProjectSpec.h:235
std::string _sceneXML
The full path to the scene specification xml file.
Definition: ProjectSpec.h:240
std::string getOutputName() const
Get the name of the trajectory output file.
Definition: ProjectSpec.h:120
std::string _modelName
The name of the pedestrian model.
Definition: ProjectSpec.h:250
size_t _subSteps
The number of intermediate simulation steps to take.
Definition: ProjectSpec.h:302
std::string _imgDumpPath
The path to the output folder for screen grab images.
Definition: ProjectSpec.h:291
std::string getModel() const
Get the model name.
Definition: ProjectSpec.h:112
An html logger - writes messages to a formatted html file.
Definition: Logger.h:59
The simulator database class.
Definition: SimulatorDB.h:117
float _timeStep
The size of the simulation time step.
Definition: ProjectSpec.h:281
std::string getDumpPath() const
Get the path at which to dump files.
Definition: ProjectSpec.h:156
std::string _scbVersion
The scb version to write.
Definition: ProjectSpec.h:260
The specificaiton of a message logger for menge, such that all messages to the system get properly re...
The specificaiton of a simulation project.
Definition: ProjectSpec.h:80
bool _verbose
Determines if the simulator should be verbose (printing status to the console.
Definition: ProjectSpec.h:266
size_t getSubSteps() const
Get the number of simulation sub steps to take.
Definition: ProjectSpec.h:163
bool getVerbosity() const
Get the verbosity state for the application.
Definition: ProjectSpec.h:134
int _seed
The seed number for the global random number generator.
Definition: ProjectSpec.h:286
std::string _scbFileName
The name of the output trajectory file to write.
Definition: ProjectSpec.h:255
std::string _behaviorXML
The full path to the behavior specification xml file.
Definition: ProjectSpec.h:245
int getRandomSeed() const
Get the random number seed value.
Definition: ProjectSpec.h:149
std::string getScene() const
Get the scene specification file name.
Definition: ProjectSpec.h:98
std::string _viewConfig
The path to the file that specifies the view configuration.
Definition: ProjectSpec.h:271
std::string getSCBVersion() const
Get the version string for the trajectory output file.
Definition: ProjectSpec.h:127