SUMO - Simulation of Urban MObility
MSCFModel_PWag2009.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // Scalable model based on Krauß by Peter Wagner
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_PWag2009_h
00022 #define MSCFModel_PWag2009_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 <utils/xml/SUMOXMLDefinitions.h>
00035 
00036 
00037 // ===========================================================================
00038 // class definitions
00039 // ===========================================================================
00044 class MSCFModel_PWag2009 : public MSCFModel {
00045 public:
00052     MSCFModel_PWag2009(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle,
00053                        SUMOReal headwayTime, SUMOReal tauLast, SUMOReal apProb);
00054 
00055 
00057     ~MSCFModel_PWag2009();
00058 
00059 
00062 
00068     SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
00069 
00070 
00079     SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
00080 
00081 
00089     SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap2pred) const;
00090 
00091 
00096     int getModelID() const {
00097         return SUMO_TAG_CF_PWAGNER2009;
00098     }
00099 
00100 
00104     SUMOReal getImperfection() const {
00105         return myDawdle;
00106     }
00108 
00109 
00110 
00115     MSCFModel* duplicate(const MSVehicleType* vtype) const;
00116 
00117 
00118     virtual MSCFModel::VehicleVariables* createVehicleVariables() const {
00119         return new VehicleVariables();
00120     }
00121 
00122 
00123 private:
00124     class VehicleVariables : public MSCFModel::VehicleVariables {
00125     public:
00126         SUMOReal aOld;
00127     };
00128 
00134     SUMOReal _v(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed) const;
00135 
00136 
00141     SUMOReal dawdle(SUMOReal speed) const;
00142 
00143 private:
00147     SUMOReal myDawdle;
00148 
00150     SUMOReal myTauDecel;
00151 
00153     SUMOReal myDecelDivTau;
00154 
00156     SUMOReal myTauLastDecel;
00157 
00159     SUMOReal myActionPointProbability;
00161 
00162 };
00163 
00164 #endif  /* MSCFModel_PWag2009_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines