Simulation.h 2.77 KB
Newer Older
Ulrich Kemloh's avatar
Ulrich Kemloh committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/*Simulation.h:
  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.
  Copyright (C) <2009-2010>  <Jonas Mehlich and Mohcine Chraibi>

  This file is part of OpenPedSim.

  OpenPedSim 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.

  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  OpenPedSim is distributed in the hope that it will be useful,
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Foobar. If not, see <http://www.gnu.org/licenses/>.
 */

#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"
35
#include "routing/DummyRouter.h"
36
#include "routing/GraphRouter.h"
37
#include "routing/NavMesh.h"
Ulrich Kemloh's avatar
Ulrich Kemloh committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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
#include "pedestrian/PedDistributor.h"


extern OutputHandler* Log;

class Simulation {
private:
    bool pLinkedCells; // true, wenn LinkedCell-Listen
    int pActionPt; // on or off
    int pNPeds; // number of pedestrians
    double pTmax; // Maximale Simulationszeit
    double pDt; // Zeitschritt
    double fps; // framerate
    Building* pBuilding; // Geometrie mit Rooms, SubRooms und Wänden
    PedDistributor* pDistribution; // verteilt die Fußgänger zu Beginn der Simulation
    DirectionStrategy* pDirection; // gibt die Richtungswahl zum Ziel an
    ForceModel* pModel; // das verwendete Kraftmodell (im Moment nur GCFM)
    ODESolver* pSolver; // Löser für die ODE
    IODispatcher* iod;
    Trajectories* pTrajectories;

public:
    // Konstruktor
    Simulation();
    virtual ~Simulation();
    // Setter-Funktionen
    int SetOnline(bool o); // setzt online auf true oder false
    int SetLinkedCells(bool l);
    int SetNPeds(int i);
    // Getter-Funktionen
    bool IsOnline() const;
    bool IsLinkedCells();
    int GetNPeds() const;
    int GetNPedsGlobal() const;
    Building* GetBuilding() const;
    // Sonstige-Funktionen
    void InitArgs(ArgumentParser *args);
    int InitSimulation();
    int RunSimulation();
    void Update(); // update the complete system
    void DistributeDestinations(); //assign the pedestrians their final destinations

    void InitRoutineClearing(); // set some parameters specific to routine clearing

};

#endif /*SIMULATION_H_*/