SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // The psycho-physical model of Wiedemann 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00012 /****************************************************************************/ 00013 // 00014 // This file is part of SUMO. 00015 // SUMO is free software: you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation, either version 3 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef MSCFModel_Wiedemann_H 00022 #define MSCFModel_Wiedemann_H 00023 00024 // =========================================================================== 00025 // included modules 00026 // =========================================================================== 00027 #ifdef _MSC_VER 00028 #include <windows_config.h> 00029 #else 00030 #include <config.h> 00031 #endif 00032 00033 #include <microsim/MSCFModel.h> 00034 #include <microsim/MSLane.h> 00035 #include <microsim/MSVehicle.h> 00036 #include <microsim/MSVehicleType.h> 00037 #include <utils/xml/SUMOXMLDefinitions.h> 00038 00039 00040 // =========================================================================== 00041 // class definitions 00042 // =========================================================================== 00047 class MSCFModel_Wiedemann : public MSCFModel { 00048 public: 00049 00060 MSCFModel_Wiedemann(const MSVehicleType* vtype, 00061 SUMOReal accel, SUMOReal decel, 00062 SUMOReal security, SUMOReal estimation); 00063 00064 00066 ~MSCFModel_Wiedemann(); 00067 00068 00071 00077 SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const; 00078 00079 00088 SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const; 00089 00090 00098 SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap) const; 00099 00100 00110 SUMOReal interactionGap(const MSVehicle* const , SUMOReal vL) const; 00111 00112 00117 int getModelID() const { 00118 return SUMO_TAG_CF_WIEDEMANN; 00119 } 00120 00121 00126 MSCFModel* duplicate(const MSVehicleType* vtype) const; 00127 00128 00129 VehicleVariables* createVehicleVariables() const { 00130 return new VehicleVariables(); 00131 } 00133 00134 00135 private: 00136 class VehicleVariables : public MSCFModel::VehicleVariables { 00137 public: 00138 VehicleVariables() : accelSign(1) {} 00140 SUMOReal accelSign; 00141 }; 00142 00143 00144 private: 00145 /* @brief the main enty point for the speed computation 00146 * @param[in] gap The netto gap (front bumper of ego to back bumper of leader) 00147 */ 00148 SUMOReal _v(const MSVehicle* veh, SUMOReal predSpeed, SUMOReal gap) const; 00149 00152 SUMOReal fullspeed(SUMOReal v, SUMOReal vpref, SUMOReal dx, SUMOReal bx) const; // also 'WUNSCH' 00153 SUMOReal following(SUMOReal sign) const; // also 'FOLGEN' 00154 SUMOReal approaching(SUMOReal dv, SUMOReal dx, SUMOReal bx) const; // also 'BREMSBX' 00155 SUMOReal emergency(SUMOReal dv, SUMOReal dx) const; // also 'BREMSAX' 00157 00158 private: 00161 00163 const SUMOReal mySecurity; 00164 00166 const SUMOReal myEstimation; 00167 00169 const SUMOReal myAX; 00170 00172 const SUMOReal myCX; 00173 00175 const SUMOReal myMinAccel; 00176 00178 static const SUMOReal D_MAX; 00180 00182 // standing obstacles (see MSCFModel_Krauss::_vsafe) 00183 SUMOReal krauss_vsafe(SUMOReal gap, SUMOReal predSpeed) const; 00184 }; 00185 00186 #endif /* MSCFModel_Wiedemann_H */