SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSCFModel_Daniel1.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The original Krauss (1998) car-following model and parameter
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSCFModel_Daniel1_h
21 #define MSCFModel_Daniel1_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "MSCFModel.h"
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
43 class MSCFModel_Daniel1 : public MSCFModel {
44 public:
51  MSCFModel_Daniel1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime,
52  SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5);
53 
54 
57 
58 
61 
67  SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
68 
69 
78  virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
79 
80 
88  virtual SUMOReal stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap2pred) const;
89 
90 
95  virtual int getModelID() const {
96  return SUMO_TAG_CF_DANIEL1;
97  }
98 
99 
104  return myDawdle;
105  }
107 
108 
109 
112 
115  void setMaxDecel(SUMOReal decel) {
116  myDecel = decel;
118  }
119 
120 
124  void setImperfection(SUMOReal imperfection) {
125  myDawdle = imperfection;
126  }
127 
128 
132  void setHeadwayTime(SUMOReal headwayTime) {
133  myHeadwayTime = headwayTime;
134  myTauDecel = myDecel * headwayTime;
135  }
137 
138 
143  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
144 
145 private:
151  virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const;
152 
153 
158  virtual SUMOReal dawdle(SUMOReal speed) const;
159 
160 protected:
163 
166 
169 
170 };
171 
172 #endif /* MSCFModel_Daniel1_H */
173