1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    MSCFModel_KraussX.h
11 /// @author  Jakob Erdmann
12 /// @date    27 Feb 2017
13 /// @version $Id$
14 ///
15 // Experimental extensions to the Krauss car-following model
16 /****************************************************************************/
17 #ifndef MSCFModel_KraussX_h
18 #define MSCFModel_KraussX_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include "MSCFModel_Krauss.h"
26 #include <utils/xml/SUMOXMLDefinitions.h>
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
32 /** @class MSCFModel_KraussX
33  * @brief Krauss car-following model, changing accel and speed by slope
34  * @see MSCFModel
35  * @see MSCFModel_Krauss
36  */
37 class MSCFModel_KraussX : public MSCFModel_Krauss {
38 public:
39     /** @brief Constructor
40      *  @param[in] vtype the type for which this model is built and also the parameter object to configure this model
41      */
42     MSCFModel_KraussX(const MSVehicleType* vtype);
43 
44 
45     /// @brief Destructor
46     ~MSCFModel_KraussX();
47 
48 
49     /// @name Implementations of the MSCFModel interface
50     /// @{
51     /// @brief apply dawdling
52     double patchSpeedBeforeLC(const MSVehicle* veh, double vMin, double vMax) const;
53 
54 
55     /** @brief Returns the model's name
56      * @return The model's name
57      * @see MSCFModel::getModelName
58      */
getModelID()59     int getModelID() const {
60         return SUMO_TAG_CF_KRAUSSX;
61     }
62     /// @}
63 
64 
65     /** @brief Duplicates the car-following model
66      * @param[in] vtype The vehicle type this model belongs to (1:1)
67      * @return A duplicate of this car-following model
68      */
69     MSCFModel* duplicate(const MSVehicleType* vtype) const;
70 
71 private:
72 
73 
74     /** @brief Applies driver imperfection (dawdling / sigma)
75      * @param[in] vOld The previous speed
76      * @param[in] vMin The minimum speed (due to braking constraints)
77      * @param[in] vMax The maximum speed that may be driven (all constraints)
78      * @return The speed after dawdling
79      *
80      */
81     double dawdleX(double vOld, double vMin, double vMax, std::mt19937* rng) const;
82 
83     /// @brief extension parameter nr1
84     double myTmp1;
85     double myTmp2;
86 
87 };
88 
89 #endif /* MSCFModel_KraussX_H */
90 
91