SUMO - Simulation of Urban MObility

MSCFModel_Wiedemann.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The psycho-physical model of Wiedemann
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_Wiedemann_H
00020 #define MSCFModel_Wiedemann_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_Wiedemann : public MSCFModel {
00046 public:
00047 
00058     MSCFModel_Wiedemann(const MSVehicleType* vtype,
00059                         SUMOReal accel, SUMOReal decel,
00060                         SUMOReal security, SUMOReal estimation);
00061 
00062 
00064     ~MSCFModel_Wiedemann();
00065 
00066 
00069 
00075     SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
00076 
00077 
00086     SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
00087 
00088 
00096     SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap) const;
00097 
00098 
00108     SUMOReal interactionGap(const MSVehicle* const , SUMOReal vL) const;
00109 
00110 
00115     int getModelID() const {
00116         return SUMO_TAG_CF_WIEDEMANN;
00117     }
00118 
00119 
00124     MSCFModel* duplicate(const MSVehicleType* vtype) const;
00125 
00126 
00127     VehicleVariables* createVehicleVariables() const {
00128         return new VehicleVariables();
00129     }
00131 
00132 
00133 private:
00134     class VehicleVariables : public MSCFModel::VehicleVariables {
00135     public:
00136         VehicleVariables() : accelSign(1) {}
00138         SUMOReal accelSign;
00139     };
00140 
00141 
00142 private:
00143     /* @brief the main enty point for the speed computation
00144      * @param[in] gap The netto gap (front bumper of ego to back bumper of leader)
00145      */
00146     SUMOReal _v(const MSVehicle* veh, SUMOReal predSpeed, SUMOReal gap) const;
00147 
00150     SUMOReal fullspeed(SUMOReal v, SUMOReal vpref, SUMOReal dx, SUMOReal bx) const; // also 'WUNSCH'
00151     SUMOReal following(SUMOReal sign) const; // also 'FOLGEN'
00152     SUMOReal approaching(SUMOReal dv, SUMOReal dx, SUMOReal bx) const;  // also 'BREMSBX'
00153     SUMOReal emergency(SUMOReal dv, SUMOReal dx) const; // also 'BREMSAX'
00155 
00156 private:
00159 
00161     const SUMOReal mySecurity;
00162 
00164     const SUMOReal myEstimation;
00165 
00167     const SUMOReal myAX;
00168 
00170     const SUMOReal myCX;
00171 
00173     const SUMOReal myMinAccel;
00174 
00176     static const SUMOReal D_MAX;
00178 
00180     // standing obstacles (see MSCFModel_Krauss::_vsafe)
00181     SUMOReal krauss_vsafe(SUMOReal gap, SUMOReal predSpeed) const;
00182 };
00183 
00184 #endif  /* MSCFModel_Wiedemann_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines