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