SUMO - Simulation of Urban MObility

MSCFModel_KraussOrig1.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The original Krauss (1998) car-following model and parameter
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef MSCFModel_KraussOrig1_h
00020 #define MSCFModel_KraussOrig1_h
00021 
00022 // ===========================================================================
00023 // included modules
00024 // ===========================================================================
00025 #ifdef _MSC_VER
00026 #include <windows_config.h>
00027 #else
00028 #include <config.h>
00029 #endif
00030 
00031 #include <microsim/MSCFModel.h>
00032 #include <utils/xml/SUMOXMLDefinitions.h>
00033 
00034 
00035 // ===========================================================================
00036 // class definitions
00037 // ===========================================================================
00042 class MSCFModel_KraussOrig1 : public MSCFModel {
00043 public:
00050     MSCFModel_KraussOrig1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime);
00051 
00052 
00054     ~MSCFModel_KraussOrig1();
00055 
00056 
00059 
00065     SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
00066 
00067 
00076     virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
00077 
00078 
00086     virtual SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap2pred) const;
00087 
00088 
00093     virtual int getModelID() const {
00094         return SUMO_TAG_CF_KRAUSS_ORIG1;
00095     }
00096 
00097 
00101     SUMOReal getImperfection() const {
00102         return myDawdle;
00103     }
00105 
00106 
00107 
00110 
00113     void setMaxDecel(SUMOReal decel) {
00114         myDecel = decel;
00115         myTauDecel = myDecel*myHeadwayTime;
00116     }
00117 
00118 
00122     void setImperfection(SUMOReal imperfection) {
00123         myDawdle = imperfection;
00124     }
00125 
00126 
00130     void setHeadwayTime(SUMOReal headwayTime) {
00131         myHeadwayTime = headwayTime;
00132         myTauDecel = myDecel*headwayTime;
00133     }
00135 
00136 
00141     virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
00142 
00143 private:
00149     virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const;
00150 
00151 
00156     virtual SUMOReal dawdle(SUMOReal speed) const;
00157 
00158 protected:
00160     SUMOReal myDawdle;
00161 
00163     SUMOReal myTauDecel;
00164 };
00165 
00166 #endif  /* MSCFModel_KraussOrig1_H */
00167 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines