SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSCFModel_KraussOrig1.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // The original Krauss (1998) car-following model and parameter
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef MSCFModel_KraussOrig1_h
24 #define MSCFModel_KraussOrig1_h
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <microsim/MSCFModel.h>
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
47 public:
54  MSCFModel_KraussOrig1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime);
55 
56 
59 
60 
63 
69  SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
70 
71 
80  virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
81 
82 
90  virtual SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap2pred) const;
91 
92 
97  virtual int getModelID() const {
99  }
100 
101 
106  return myDawdle;
107  }
109 
110 
111 
114 
117  void setMaxDecel(SUMOReal decel) {
118  myDecel = decel;
120  }
121 
122 
126  void setImperfection(SUMOReal imperfection) {
127  myDawdle = imperfection;
128  }
129 
130 
134  void setHeadwayTime(SUMOReal headwayTime) {
135  myHeadwayTime = headwayTime;
136  myTauDecel = myDecel * headwayTime;
137  }
139 
140 
145  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
146 
147 private:
153  virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const;
154 
155 
160  virtual SUMOReal dawdle(SUMOReal speed) const;
161 
162 protected:
165 
168 };
169 
170 #endif /* MSCFModel_KraussOrig1_H */
171