SUMO - Simulation of Urban MObility
MSCFModel_KraussAccelBound.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // Krauss car-following model, with PHEMlight-based acceleration limits
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #include <utils/common/StdDefs.h>
33 #include <microsim/MSVehicle.h>
34 #include <microsim/MSLane.h>
36 
37 
38 // ===========================================================================
39 // method definitions
40 // ===========================================================================
42  SUMOReal dawdle, SUMOReal headwayTime)
43  : MSCFModel_Krauss(vtype, accel, decel, dawdle, headwayTime) {
44 }
45 
46 
48 
49 
50 
53  const MSLane* const lane = veh->getLane();
55  const SUMOReal slope = lane->getShape().slopeDegreeAtOffset(gp);
56  const SUMOReal aMax = PollutantsInterface::getMaxAccel(veh->getVehicleType().getEmissionClass(), speed, 0, slope);
57  return MIN2(speed + (SUMOReal) ACCEL2SPEED(aMax), veh->getVehicleType().getMaxSpeed());
58 }
59 
60 
61 
62 MSCFModel*
65 }
66 
67 
68 //void MSCFModel::saveState(std::ostream &os) {}
69 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
SUMOReal getMaxSpeed() const
Get vehicle's maximum speed [m/s].
SUMOReal maxNextSpeed(SUMOReal speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
#define ACCEL2SPEED(x)
Definition: SUMOTime.h:61
The car-following model abstraction.
Definition: MSCFModel.h:59
SUMOReal myAccel
The vehicle's maximum acceleration [m/s^2].
Definition: MSCFModel.h:345
SUMOReal myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
Definition: MSCFModel.h:351
SUMOReal getPositionOnLane() const
Get the vehicle's position along the lane.
Definition: MSVehicle.h:286
The car-following model and parameter.
Definition: MSVehicleType.h:74
SUMOReal slopeDegreeAtOffset(SUMOReal pos) const
Returns the slope at the given length.
SUMOReal myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
MSCFModel_KraussAccelBound(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime)
Constructor.
T MIN2(T a, T b)
Definition: StdDefs.h:68
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
Definition: MSLane.h:334
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:90
static SUMOReal getMaxAccel(SUMOEmissionClass c, double v, double a, double slope)
Returns the maximum possible acceleration.
const PositionVector & getShape() const
Returns this lane's shape.
Definition: MSLane.h:323
#define SUMOReal
Definition: config.h:218
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:331
Krauss car-following model, with acceleration decrease and faster start.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].
Definition: MSCFModel.h:348