Simulation.h 3.58 KB
Newer Older
1
/**
Ulrich Kemloh's avatar
Ulrich Kemloh committed
2 3 4 5
 * \file        Simulation.h
 * \date        Dec 15, 2010
 * \version     v0.5
 * \copyright   <2009-2014> Forschungszentrum Jülich GmbH. All rights reserved.
6
 *
Ulrich Kemloh's avatar
Ulrich Kemloh committed
7
 * \section License
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 * This file is part of JuPedSim.
 *
 * JuPedSim is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * JuPedSim is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
 *
Ulrich Kemloh's avatar
Ulrich Kemloh committed
23
 * \section Description
24 25 26 27
 * The Simulation class represents a simulation of pedestrians
 * based on a certain model in a specific scenario. A simulation is defined by
 * various parameters and functions.
 *
Ulrich Kemloh's avatar
Ulrich Kemloh committed
28 29 30 31
 *
 **/


Ulrich Kemloh's avatar
Ulrich Kemloh committed
32 33 34 35 36 37 38 39 40 41 42 43 44

#ifndef SIMULATION_H_
#define SIMULATION_H_

#include "general/ArgumentParser.h"
#include "geometry/Building.h"
#include "IO/OutputHandler.h"
#include "IO/IODispatcher.h"
#include "math/ForceModel.h"
#include "math/ODESolver.h"
#include "routing/GlobalRouter.h"
#include "routing/QuickestPathRouter.h"
#include "routing/DirectionStrategy.h"
45
#include "routing/DummyRouter.h"
46
#include "routing/GraphRouter.h"
47
#include "routing/NavMesh.h"
48
#include "routing/MeshRouter.h"
49
#include "routing/RoutingEngine.h"
50
#include "routing/SafestPathRouter.h"
Ulrich Kemloh's avatar
Ulrich Kemloh committed
51
#include "pedestrian/PedDistributor.h"
52
#include "events/EventManager.h"
53
#include "routing/CognitiveMapRouter.h"
Ulrich Kemloh's avatar
Ulrich Kemloh committed
54 55 56

extern OutputHandler* Log;

Ulrich Kemloh's avatar
Ulrich Kemloh committed
57

Ulrich Kemloh's avatar
Ulrich Kemloh committed
58
class Simulation {
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
private:
     ///Number of pedestrians in the simulation
     int _nPeds;
     ///Maximum simulation time
     double _tmax;
     /// time step
     double _deltaT;
     /// frame rate for the trajectories
     double _fps;
     ///seed using for the random number generator
     unsigned int _seed;
     /// building object
     Building* _building;
     ///initial distribution of the pedestrians
     PedDistributor* _distribution;
     /// door crossing strategy for the pedestrians
     DirectionStrategy* _direction;
     /// Force model to use
     ForceModel* _model;
     /// differential equation solver
     ODESolver* _solver;
     /// writing the trajectories to file
     IODispatcher* _iod;
     ///new: EventManager
     EventManager* _em;
     /// argument parser
     ArgumentParser* _argsParser;


public:
Ulrich Kemloh's avatar
Ulrich Kemloh committed
89 90 91
     /**
      * constructor
      */
92
     Simulation();
Ulrich Kemloh's avatar
Ulrich Kemloh committed
93 94 95 96

     /**
      * Destructor
      */
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
     virtual ~Simulation();

     /**
      * Initialize the number of agents in the simulation
      */
     void SetPedsNumber(int i);

     /**
      * Initialize the number of agents in the simulation
      */
     int GetPedsNumber() const;

     /**
      * Returns the number of agents when running on a distributed system (MPI)
      * NOT IMPLEMENTED
      */
     int GetNPedsGlobal() const;

     /**
      * @return the building object containing all geometry elements
      */
     Building* GetBuilding() const;

     /**
      * Read parameters from the argument parser class.
      */
     void InitArgs(ArgumentParser *args);

     /**
      *
      * @return the total simulated/evacuation time
      */
     int RunSimulation();

     /**
      * Update the pedestrians states: positions, velocity, route
      */
     void Update();

     /**
      * print some statistics about the simulation
      */
     void PrintStatistics();
Ulrich Kemloh's avatar
Ulrich Kemloh committed
140 141 142
};

#endif /*SIMULATION_H_*/