GompertzModel.h 4.76 KB
Newer Older
Ulrich Kemloh's avatar
Ulrich Kemloh committed
1
/**
2 3
 * \file        GompertzModel.h
 * \date        Apr 15, 2014
4 5
 * \version     v0.7
 * \copyright   <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
Mohcine Chraibi's avatar
Mohcine Chraibi committed
6
 * \ingroup OperationalModels
Ulrich Kemloh's avatar
Ulrich Kemloh committed
7
 *
8
 * \section License
Ulrich Kemloh's avatar
Ulrich Kemloh committed
9 10 11
 * This file is part of JuPedSim.
 *
 * JuPedSim is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU Lesser General Public License as published by
Ulrich Kemloh's avatar
Ulrich Kemloh committed
13 14 15 16 17 18 19 20
 * 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.
 *
21 22
 * You should have received a copy of the GNU Lesser General Public License
 * along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
Ulrich Kemloh's avatar
Ulrich Kemloh committed
23
 *
24
 * \section Description
Mohcine Chraibi's avatar
Mohcine Chraibi committed
25
 * Implementation of classes for Gompertz Model
26 27
 *
 **/
Ulrich Kemloh's avatar
Ulrich Kemloh committed
28 29 30 31 32 33 34 35


#ifndef GOMPERTZMODEL_H_
#define GOMPERTZMODEL_H_

#include <vector>

#include "../geometry/Building.h"
36
#include "OperationalModel.h"
Ulrich Kemloh's avatar
Ulrich Kemloh committed
37 38 39 40 41 42


//forward declaration
class Pedestrian;
class DirectionStrategy;

Mohcine Chraibi's avatar
Mohcine Chraibi committed
43 44 45 46 47 48 49 50 51
/*!
 * \class GompertzModel
 *
 * \brief @todo
 *
 *\ingroup OperationalModels
 *
 * \author Mohcine Chraibi
 */
52
class GompertzModel : public OperationalModel {
Ulrich Kemloh's avatar
Ulrich Kemloh committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66
private:

     /// Modellparameter
     double _nuPed;
     double _aPed;
     double _bPed;
     double _cPed;

     double _nuWall;
     double _aWall;
     double _bWall;
     double _cWall;

     /**
67
      * Driving force \f$ F_i =\frac{\mathbf{v_0}-\mathbf{v_i}}{\tau}\f$
Ulrich Kemloh's avatar
Ulrich Kemloh committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
      * This is a duplicate of @see GCFMModel::ForceDriv
      * @param ped Pointer to Pedestrians
      * @param room Pointer to Room
      *
      *
      * @return Point
      */
     Point ForceDriv(Pedestrian* ped, Room* room) const;
     /**
      * Repulsive force between two pedestrians ped1 and ped2 according to
      * the Gompertz model (unpublished)
      *
      * @param ped1 Pointer to Pedestrian: First pedestrian
      * @param ped2 Pointer to Pedestrian: Second pedestrian
      *
      * @return Point
      */
     Point ForceRepPed(Pedestrian* ped1, Pedestrian* ped2) const;
     /**
      * Repulsive force acting on pedestrian <ped> from the walls in
      * <subroom>. The sum of all repulsive forces of the walls in <subroom> is calculated
      * @see ForceRepWall
      * @param ped Pointer to Pedestrian
      * @param subroom Pointer to SubRoom
      *
      * @return Point
      */
     Point ForceRepRoom(Pedestrian* ped, SubRoom* subroom) const;
     /**
      * Repulsive force between pedestrian <ped> and wall <l>
      *
      * @param ped Pointer to Pedestrian
      * @param l reference to Wall
      *
      * @return Point
      */
104
     Point ForceRepWall(Pedestrian* ped, const Line& l, const Point& centroid, bool inside) const;
Ulrich Kemloh's avatar
Ulrich Kemloh committed
105 106 107

public:

GrgrLmml's avatar
GrgrLmml committed
108
     GompertzModel(std::shared_ptr<DirectionStrategy> dir, double nuped, double aped, double bped, double cped,
Ulrich Kemloh's avatar
Ulrich Kemloh committed
109 110 111
                   double nuwall, double awall, double bwall, double cwall);
     virtual ~GompertzModel(void);

GrgrLmml's avatar
GrgrLmml committed
112
    std::shared_ptr<DirectionStrategy> GetDirection() const;
113

Ulrich Kemloh's avatar
Ulrich Kemloh committed
114 115 116 117 118 119
     /**
      * Get the parameter for the strength of the ped-PED repulsive force
      *
      * @return double
      */
     double GetNuPed() const;
120

Ulrich Kemloh's avatar
Ulrich Kemloh committed
121 122 123 124 125 126
     /**
      * ToDO: What is this parameter doing?
      *
      * @return double
      */
     double GetaPed() const;
127

Ulrich Kemloh's avatar
Ulrich Kemloh committed
128 129 130 131 132 133
     /**
      * ToDO: What is this parameter doing?
      *
      * @return double
      */
     double GetbPed() const;
134

Ulrich Kemloh's avatar
Ulrich Kemloh committed
135 136 137 138 139 140 141 142 143 144 145 146 147
     /**
      * ToDO: What is this parameter doing?
      *
      * @return double
      */
     double GetcPed() const;

     /**
      * Get the parameter for the strength of the ped-WALL repulsive force
      *
      * @return
      */
     double GetNuWall() const;
148

Ulrich Kemloh's avatar
Ulrich Kemloh committed
149 150 151 152 153 154
     /**
      * ToDO: What is this parameter doing?
      *
      * @return double
      */
     double GetaWall() const;
155

Ulrich Kemloh's avatar
Ulrich Kemloh committed
156 157 158 159 160 161
     /**
      * ToDO: What is this parameter doing?
      *
      * @return double
      */
     double GetbWall() const;
162

Ulrich Kemloh's avatar
Ulrich Kemloh committed
163 164 165 166 167 168 169 170 171 172
     /**
      * ToDO: What is this parameter doing?
      *
      * @return double
      */
     double GetcWall() const;

     /**
      * @return all model parameters in a nicely formatted string
      */
Ulrich Kemloh's avatar
Ulrich Kemloh committed
173
     virtual std::string GetDescription();
174 175 176 177 178

     /**
      * initialize the phi angle
      * @param building
      */
Ulrich Kemloh's avatar
Ulrich Kemloh committed
179
     virtual bool Init (Building* building);
180 181 182

     /**
      * Compute the next simulation step
183 184 185 186
      * Solve the differential equations and update the positions and velocities
      * @param current the actual time
      * @param deltaT the next timestep
      * @param building the geometry object
187
      */
Ulrich Kemloh's avatar
Ulrich Kemloh committed
188
     virtual void ComputeNextTimeStep(double current, double deltaT, Building* building, int periodic);
Ulrich Kemloh's avatar
Ulrich Kemloh committed
189 190 191 192
};


#endif /* GOMPERTZMODEL_H_ */