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 /****************************************************************************/
8 // The original Krauss (1998) car-following model and parameter
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef MSCFModel_Daniel1_h
22 #define MSCFModel_Daniel1_h
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "MSCFModel.h"
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
44 class MSCFModel_Daniel1 : public MSCFModel {
45 public:
52  MSCFModel_Daniel1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime,
53  SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5);
54 
55 
58 
59 
62 
68  SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const;
69 
70 
79  virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const;
80 
81 
89  virtual SUMOReal stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap2pred) const;
90 
91 
96  virtual int getModelID() const {
97  return SUMO_TAG_CF_DANIEL1;
98  }
99 
100 
105  return myDawdle;
106  }
108 
109 
110 
113 
116  void setMaxDecel(SUMOReal decel) {
117  myDecel = decel;
119  }
120 
121 
125  void setImperfection(SUMOReal imperfection) {
126  myDawdle = imperfection;
127  }
128 
129 
133  void setHeadwayTime(SUMOReal headwayTime) {
134  myHeadwayTime = headwayTime;
135  myTauDecel = myDecel * headwayTime;
136  }
138 
139 
144  virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
145 
146 private:
152  virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const;
153 
154 
159  virtual SUMOReal dawdle(SUMOReal speed) const;
160 
161 protected:
164 
167 
170 
171 };
172 
173 #endif /* MSCFModel_Daniel1_H */
174