SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00010 // The original Krauss (1998) car-following model and parameter 00011 /****************************************************************************/ 00012 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00013 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00014 /****************************************************************************/ 00015 // 00016 // This file is part of SUMO. 00017 // SUMO is free software: you can redistribute it and/or modify 00018 // it under the terms of the GNU General Public License as published by 00019 // the Free Software Foundation, either version 3 of the License, or 00020 // (at your option) any later version. 00021 // 00022 /****************************************************************************/ 00023 #ifndef MSCFModel_KraussOrig1_h 00024 #define MSCFModel_KraussOrig1_h 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <microsim/MSCFModel.h> 00036 #include <utils/xml/SUMOXMLDefinitions.h> 00037 00038 00039 // =========================================================================== 00040 // class definitions 00041 // =========================================================================== 00046 class MSCFModel_KraussOrig1 : public MSCFModel { 00047 public: 00054 MSCFModel_KraussOrig1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime); 00055 00056 00058 ~MSCFModel_KraussOrig1(); 00059 00060 00063 00069 SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const; 00070 00071 00080 virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const; 00081 00082 00090 virtual SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap2pred) const; 00091 00092 00097 virtual int getModelID() const { 00098 return SUMO_TAG_CF_KRAUSS_ORIG1; 00099 } 00100 00101 00105 SUMOReal getImperfection() const { 00106 return myDawdle; 00107 } 00109 00110 00111 00114 00117 void setMaxDecel(SUMOReal decel) { 00118 myDecel = decel; 00119 myTauDecel = myDecel * myHeadwayTime; 00120 } 00121 00122 00126 void setImperfection(SUMOReal imperfection) { 00127 myDawdle = imperfection; 00128 } 00129 00130 00134 void setHeadwayTime(SUMOReal headwayTime) { 00135 myHeadwayTime = headwayTime; 00136 myTauDecel = myDecel * headwayTime; 00137 } 00139 00140 00145 virtual MSCFModel* duplicate(const MSVehicleType* vtype) const; 00146 00147 private: 00153 virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const; 00154 00155 00160 virtual SUMOReal dawdle(SUMOReal speed) const; 00161 00162 protected: 00164 SUMOReal myDawdle; 00165 00167 SUMOReal myTauDecel; 00168 }; 00169 00170 #endif /* MSCFModel_KraussOrig1_H */ 00171