GCFMModel.h 4.16 KB
 Ulrich Kemloh committed May 30, 2014 1 /**  Weichen committed Jul 04, 2014 2 3 4 5  * \file GCFMModel.h * \date Apr 15, 2014 * \version v0.5 * \copyright <2009-2014> Forschungszentrum Jülich GmbH. All rights reserved.  Ulrich Kemloh committed May 30, 2014 6  *  Weichen committed Jul 04, 2014 7  * \section License  Ulrich Kemloh committed May 30, 2014 8 9 10  * This file is part of JuPedSim. * * JuPedSim is free software: you can redistribute it and/or modify  Weichen committed Jul 04, 2014 11  * it under the terms of the GNU Lesser General Public License as published by  Ulrich Kemloh committed May 30, 2014 12 13 14 15 16 17 18 19  * 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. *  Weichen committed Jul 04, 2014 20  * You should have received a copy of the GNU Lesser General Public License  Ulrich Kemloh committed May 30, 2014 21 22  * along with JuPedSim. If not, see . *  Weichen committed Jul 04, 2014 23  * \section Description  Ulrich Kemloh committed May 30, 2014 24 25 26 27  * Implementation of classes for force-based models. * Actually we've got two different models: * 1. Generalized Centrifugal Force Model *  Weichen committed Jul 04, 2014 28 29  * **/  Ulrich Kemloh committed May 30, 2014 30 31 32 33 34 35 36 37  #ifndef GCFMMODEL_H_ #define GCFMMODEL_H_ #include #include "../geometry/Building.h"  Ulrich Kemloh committed Nov 05, 2014 38 #include "OperationalModel.h"  Ulrich Kemloh committed May 30, 2014 39 40 41 42 43 44 45 46  //forward declaration class Pedestrian; class DirectionStrategy;  Ulrich Kemloh committed Nov 05, 2014 47 48 class GCFMModel : public OperationalModel {  Ulrich Kemloh committed May 30, 2014 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 public: GCFMModel(DirectionStrategy* dir, double nuped, double nuwall, double dist_effPed, double dist_effWall, double intp_widthped, double intp_widthwall, double maxfped, double maxfwall); virtual ~GCFMModel(void); // Getter DirectionStrategy* GetDirection() const; double GetNuPed() const; double GetNuWall() const; double GetDistEffMax() const; double GetIntpWidthPed() const; double GetIntpWidthWall() const; double GetMaxFPed() const; double GetMaxFWall() const; double GetDistEffMaxPed() const; double GetDistEffMaxWall() const; // virtual function  Ulrich Kemloh committed Nov 05, 2014 68 69  virtual void ComputeNextTimeStep(double current, double deltaT, Building* building) const; virtual std::string GetDescription() const;  Ulrich Kemloh committed Oct 29, 2014 70  virtual void Init (Building* building) const;  Ulrich Kemloh committed May 30, 2014 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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118  private: /// define the strategy for crossing a door (used for calculating the driving force) DirectionStrategy* _direction; // Modellparameter double _nuPed; /**< strength of the pedestrian repulsive force */ double _nuWall; /**< strength of the wall repulsive force */ double _intp_widthPed; /**< Interpolation cutoff radius (in cm) */ double _intp_widthWall; /**< Interpolation cutoff radius (in cm) */ double _maxfPed; double _maxfWall; double _distEffMaxPed; // maximal effective distance double _distEffMaxWall; // maximal effective distance // Private Funktionen /** * Driving force \f$F_i =\frac{\mathbf{v_0}-\mathbf{v_i}}{\tau}\f$ * * @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 Generalized Centrifugal Force Model (chraibi2010a) * * @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 from the walls in * . The sum of all repulsive forces of the walls in is calculated * @see ForceRepWall * @param ped Pointer to Pedestrian * @param subroom Pointer to SubRoom * * @return */ Point ForceRepRoom(Pedestrian* ped, SubRoom* subroom) const; Point ForceRepWall(Pedestrian* ped, const Wall& l) const; Point ForceRepStatPoint(Pedestrian* ped, const Point& p, double l, double vn) const; Point ForceInterpolation(double v0, double K_ij, const Point& e, double v, double d, double r, double l) const;  Ulrich Kemloh committed Nov 05, 2014 119 120 121 122 123 124 125 126 127  /** * Calculate the forces and update the pedestrians position and velocities * @param t * @param tp * @param building */ void CalculateForce(double t, double tp, Building* building) const;  Ulrich Kemloh committed May 30, 2014 128 129 130 131 }; #endif /* GCFMMODEL_H_ */