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_KraussPS.h
11 /// @author  Tobias Mayer
12 /// @author  Daniel Krajzewicz
13 /// @author  Jakob Erdmann
14 /// @author  Michael Behrisch
15 /// @date    Tue, 28 Jul 2009
16 /// @version $Id$
17 ///
18 // Krauss car-following model, changing accel and speed by slope
19 /****************************************************************************/
20 #ifndef MSCFModel_KraussPS_h
21 #define MSCFModel_KraussPS_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include "MSCFModel_Krauss.h"
29 #include <utils/xml/SUMOXMLDefinitions.h>
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
35 /** @class MSCFModel_KraussPS
36  * @brief Krauss car-following model, changing accel and speed by slope
37  * @see MSCFModel
38  * @see MSCFModel_Krauss
39  */
40 class MSCFModel_KraussPS : public MSCFModel_Krauss {
41 public:
42     /** @brief Constructor
43      *  @param[in] vtype the type for which this model is built and also the parameter object to configure this model
44      */
45     MSCFModel_KraussPS(const MSVehicleType* vtype);
46 
47 
48     /// @brief Destructor
49     ~MSCFModel_KraussPS();
50 
51 
52     /// @name Implementations of the MSCFModel interface
53     /// @{
54 
55     /** @brief Returns the maximum speed given the current speed
56      *
57      * The implementation of this method must take into account the time step
58      *  duration.
59      *
60      * Justification: Due to air brake or other influences, the vehicle's next maximum
61      *  speed may depend on the vehicle's current speed (given).
62      *
63      * @param[in] speed The vehicle's current speed
64      * @param[in] speed The vehicle itself, for obtaining other values
65      * @return The maximum possible speed for the next step
66      */
67     double maxNextSpeed(double speed, const MSVehicle* const veh) const;
68 
69 
70     /** @brief Returns the model's name
71      * @return The model's name
72      * @see MSCFModel::getModelName
73      */
getModelID()74     int getModelID() const {
75         return SUMO_TAG_CF_KRAUSS_PLUS_SLOPE;
76     }
77     /// @}
78 
79 
80     /** @brief Duplicates the car-following model
81      * @param[in] vtype The vehicle type this model belongs to (1:1)
82      * @return A duplicate of this car-following model
83      */
84     MSCFModel* duplicate(const MSVehicleType* vtype) const;
85 
86 
87 };
88 
89 #endif /* MSCFModel_KraussPS_H */
90 
91