SUMO - Simulation of Urban MObility

MSCFModel_PWag2009.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Scalable model based on Krauß by Peter Wagner
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_PWag2009_h
00020 #define MSCFModel_PWag2009_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_PWag2009 : public MSCFModel {
00043 public:
00050     MSCFModel_PWag2009(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle,
00051                        SUMOReal headwayTime, SUMOReal tauLast, SUMOReal apProb);
00052 
00053 
00055     ~MSCFModel_PWag2009();
00056 
00057 
00060 
00066     SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
00067 
00068 
00077     SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
00078 
00079 
00087     SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap2pred) const;
00088 
00089 
00094     int getModelID() const {
00095         return SUMO_TAG_CF_PWAGNER2009;
00096     }
00097 
00098 
00102     SUMOReal getImperfection() const {
00103         return myDawdle;
00104     }
00106 
00107 
00108 
00113     MSCFModel* duplicate(const MSVehicleType* vtype) const;
00114 
00115 
00116     virtual MSCFModel::VehicleVariables* createVehicleVariables() const {
00117         return new VehicleVariables();
00118     }
00119 
00120 
00121 private:
00122     class VehicleVariables : public MSCFModel::VehicleVariables {
00123     public:
00124         SUMOReal aOld;
00125     };
00126 
00132     SUMOReal _v(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed) const;
00133 
00134 
00139     SUMOReal dawdle(SUMOReal speed) const;
00140 
00141 private:
00145     SUMOReal myDawdle;
00146 
00148     SUMOReal myTauDecel;
00149 
00151     SUMOReal myDecelDivTau;
00152 
00154     SUMOReal myTauLastDecel;
00155 
00157     SUMOReal myActionPointProbability;
00159 
00160 };
00161 
00162 #endif  /* MSCFModel_PWag2009_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines