![]() |
Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The specificaiton of a simulation project. More...
#include <ProjectSpec.h>
Public Member Functions | |
ProjectSpec () | |
Constructor. | |
~ProjectSpec () | |
Destructor. | |
std::string | getScene () const |
Get the scene specification file name. More... | |
std::string | getBehavior () const |
Get the beahvior specification file name. More... | |
std::string | getModel () const |
Get the model name. More... | |
std::string | getOutputName () const |
Get the name of the trajectory output file. More... | |
std::string | getSCBVersion () const |
Get the version string for the trajectory output file. More... | |
bool | getVerbosity () const |
Get the verbosity state for the application. More... | |
std::string | getView () const |
Get the view specification file. More... | |
int | getRandomSeed () const |
Get the random number seed value. More... | |
std::string | getDumpPath () const |
Get the path at which to dump files. More... | |
size_t | getSubSteps () const |
Get the number of simulation sub steps to take. More... | |
float | getDuration () const |
Get the maximum simulation duration. More... | |
float | getTimeStep () const |
Get the override simulation time step. More... | |
bool | parseCommandParameters (int argc, char *argv[], const SimulatorDB *simDB) |
Parse the command line arguments. More... | |
bool | fullySpecified () const |
Reports if the project specification contains enough information to attempt to run a simulation. I.e., it has values for all fields but does not know if those values are valid. More... | |
Protected Member Functions | |
void | setOutputName (const std::string &fileName) |
Set output file. More... | |
bool | loadFromXML (const std::string &xmlName) |
Loads a project specification from an xml file. More... | |
Protected Attributes | |
std::string | _projPath |
The path to the project – it is the folder containing the project xml. Defaults to the current working directory. | |
std::string | _sceneXML |
The full path to the scene specification xml file. | |
std::string | _behaviorXML |
The full path to the behavior specification xml file. | |
std::string | _modelName |
The name of the pedestrian model. | |
std::string | _scbFileName |
The name of the output trajectory file to write. | |
std::string | _scbVersion |
The scb version to write. | |
bool | _verbose |
Determines if the simulator should be verbose (printing status to the console. | |
std::string | _viewConfig |
The path to the file that specifies the view configuration. | |
float | _duration |
The maximum allowable duration of the simulation (in simulation seconds). | |
float | _timeStep |
The size of the simulation time step. | |
int | _seed |
The seed number for the global random number generator. | |
std::string | _imgDumpPath |
The path to the output folder for screen grab images. | |
size_t | _subSteps |
The number of intermediate simulation steps to take. More... | |
Friends | |
Logger & | operator<< (Logger &out, const ProjectSpec &spec) |
Print the project specification to an output stream. More... | |
The specificaiton of a simulation project.
Some project parameters have default values (such as duration and random seed). Others require explicit definitions (such as scene specification, etc.) The break down is as follows:
Required parameters:
Optional parameters (with defaults):
bool ProjectSpec::fullySpecified | ( | ) | const |
Reports if the project specification contains enough information to attempt to run a simulation. I.e., it has values for all fields but does not know if those values are valid.
|
inline |
Get the beahvior specification file name.
|
inline |
Get the path at which to dump files.
|
inline |
Get the maximum simulation duration.
|
inline |
Get the model name.
|
inline |
Get the name of the trajectory output file.
|
inline |
Get the random number seed value.
|
inline |
Get the version string for the trajectory output file.
|
inline |
Get the scene specification file name.
|
inline |
Get the number of simulation sub steps to take.
|
inline |
Get the override simulation time step.
|
inline |
Get the verbosity state for the application.
|
inline |
Get the view specification file.
|
protected |
Loads a project specification from an xml file.
The return value only indicates if there was successful parsing of the xml. It does not imply that there was sufficient information in the project to run a simulation. Ultimately, a successful project is defined by the union of the project file and the command-line parameters.
xmlName | The path to the file containing the project specification. |
bool ProjectSpec::parseCommandParameters | ( | int | argc, |
char * | argv[], | ||
const SimulatorDB * | simDB | ||
) |
Parse the command line arguments.
argc | the number of command-line arguments. |
argv | The command-line parameters. |
simDB | A pointer to the current simulator database. |
|
protected |
Set output file.
fileName | The name of the file to write the trajectories to. |
|
friend |
Print the project specification to an output stream.
out | An output stream. |
spec | A ProjectSpec |
|
protected |
The number of intermediate simulation steps to take.
If the simulation time step is N Hz, and substeps is set to k, then the effective simulation rate is N * ( 1 + k ) Hz. For example, simulate at 10 Hz, with a single substep. Simulation is performed at 10 * (1 + 1) = 20 Hz, but the results are only output at 10 Hz.