MSCFModel_IDM.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The Intellignet Driver Model (IDM) car-following model
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 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_IDM_H
00020 #define MSCFMODEL_IDM_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 <microsim/MSLane.h>
00033 #include <microsim/MSVehicle.h>
00034 #include <microsim/MSVehicleType.h>
00035 #include <utils/xml/SUMOXMLDefinitions.h>
00036 
00037 
00038 // ===========================================================================
00039 // class definitions
00040 // ===========================================================================
00045 class MSCFModel_IDM : public MSCFModel {
00046 public:
00053     MSCFModel_IDM(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel,
00054                   SUMOReal timeHeadWay, SUMOReal mingap, SUMOReal tau) throw();
00055 
00056 
00058     ~MSCFModel_IDM() throw();
00059 
00060 
00063 
00070     SUMOReal moveHelper(MSVehicle * const veh, const MSLane * const lane, SUMOReal vPos) const throw();
00071 
00072 
00081     SUMOReal ffeV(const MSVehicle * const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed) const throw();
00082 
00083 
00092     SUMOReal ffeV(const MSVehicle * const veh, SUMOReal gap2pred, SUMOReal predSpeed) const throw();
00093 
00094 
00102     SUMOReal ffeV(const MSVehicle * const veh, const MSVehicle * const pred) const throw();
00103 
00104 
00112     SUMOReal ffeS(const MSVehicle * const veh, SUMOReal gap2pred) const throw();
00113 
00114 
00124     SUMOReal interactionGap(const MSVehicle * const , SUMOReal vL) const throw();
00125 
00126 
00138     bool hasSafeGap(SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal laneMaxSpeed) const throw();
00139 
00140 
00149     SUMOReal getMaxAccel(SUMOReal v) const throw() {
00150         return myAccel;
00151     }
00152 
00153 
00158     int getModelID() const throw() {
00159         return SUMO_TAG_CF_IDM;
00160     }
00161 
00162 
00166     SUMOReal getTau() const throw() {
00167         return myTau;
00168     }
00170 
00171 
00172 
00173 
00174 private:
00175     SUMOReal _updateSpeed(SUMOReal gap2pred, SUMOReal mySpeed, SUMOReal predSpeed, SUMOReal desSpeed) const throw();
00176 
00177     SUMOReal desiredSpeed(const MSVehicle * const veh) const throw() {
00178         return MIN2(myType->getMaxSpeed(), veh->getLane().getMaxSpeed());
00179     }
00180 
00181 
00182 private:
00185 
00187     SUMOReal myAccel;
00188 
00190     SUMOReal myTimeHeadWay;
00191 
00193     SUMOReal myMinSpace;
00194 
00196     SUMOReal myTau;
00198 
00199 };
00200 
00201 #endif  /* MSCFMODEL_IDM_H */

Generated on Wed May 5 00:06:31 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6