 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
65 : myParameter(parameter), myWarnedActionStepLengthTauOnce(false), myIndex(myNextIndex++), myCarFollowModel(nullptr), myOriginalType(nullptr) {
203 assert(actionStepLength >= 0.);
224 MSVehicle* veh = static_cast<MSVehicle*>(vehIt->second);
227 if (resetActionOffset) {
289 if (emergencyDecel < decel) {
290 WRITE_WARNING(
"Value of 'emergencyDecel' (" +
toString(emergencyDecel) +
") should be higher than 'decel' (" +
toString(decel) +
") for vType '" + from.
id +
"'.");
292 if (emergencyDecel < apparentDecel) {
293 WRITE_WARNING(
"Value of 'emergencyDecel' (" +
toString(emergencyDecel) +
") is lower than 'apparentDecel' (" +
toString(apparentDecel) +
") for vType '" + from.
id +
"' may cause collisions.");
369 std::string singular = persistent ?
"" :
"singular ";
384 <<
" This may lead to collisions. (This warning is only issued once per vehicle type).";
const int VTYPEPARS_LATALIGNMENT_SET
The car-following model and parameter.
void setHeight(const double &height)
Set a new value for this type's height.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
MSVehicleType * buildSingularType(const std::string &id) const
Duplicates the microsim vehicle type giving the newly created type the given id, marking it as vehicl...
const std::string & getID() const
Returns the name of the vehicle type.
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
double length
The physical vehicle length.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
const int VTYPEPARS_MINGAP_SET
void setAccel(double accel)
Set a new value for this type's acceleration.
#define WRITE_WARNING(msg)
virtual double getImperfection() const
Get the driver's imperfection.
bool isVehicleSpecific() const
Returns whether this type belongs to a single vehicle only (was modified)
double sample(std::mt19937 *which=0) const
Draw a sample of the distribution.
virtual void setEmergencyDecel(double decel)
Sets a new value for maximal physically possible deceleration [m/s^2].
bool myWarnedActionStepLengthTauOnce
Indicator whether the user was already warned once about an action step length larger than the desire...
SUMOTime actionStepLength
The vehicle type's default actionStepLength [ms], i.e. the interval between two control actions....
LateralAlignment
Numbers representing special SUMO-XML-attribute values Information how vehicles align themselves with...
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
virtual void setImperfection(double imperfection)
Sets a new value for driver imperfection.
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
double impatience
The vehicle's impatience (willingness to obstruct others)
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
Krauss car-following model, with acceleration decrease and faster start.
void setEmergencyDecel(double emergencyDecel)
Set a new value for this type's emergency deceleration.
const int VTYPEPARS_MINGAP_LAT_SET
double getImpatience() const
Returns this type's impatience.
The CACC car-following model.
void updateActionOffset(const SUMOTime oldActionStepLength, const SUMOTime newActionStepLength)
Process an updated action step length value (only affects the vehicle's action offset,...
virtual ~MSVehicleType()
Destructor.
virtual void setApparentDecel(double decel)
Sets a new value for the apparent deceleration [m/s^2].
The W99 Model car-following model.
double carriageLength
the length of train carriages and locomotive
MSVehicleType * duplicateType(const std::string &id, bool persistent) const
Duplicates the microsim vehicle type giving the newly created type the given id.
SUMOVehicleShape shape
This class' shape.
const int VTYPEPARS_PROBABILITY_SET
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
void setWidth(const double &width)
Set a new value for this type's width.
Krauss car-following model, changing accel and speed by slope.
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
virtual void setHeadwayTime(double headwayTime)
Sets a new value for desired headway [s].
render as a flexible city bus
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
void initRailVisualizationParameters()
init Rail Visualization Parameters
The original Krauss (1998) car-following model and parameter.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
Krauss car-following model, changing accel and speed by slope.
void setColor(const RGBColor &color)
Set a new value for this type's color.
bool wasSet(int what) const
Returns whether the given parameter was set.
int parametersSet
Information for the router which parameter were set.
const int VTYPEPARS_MAXSPEED_LAT_SET
MSVehicleType(const SUMOVTypeParameter ¶meter)
Constructor.
void check()
Checks whether vehicle type parameters may be problematic (Currently, only the value for the action s...
std::vector< double > & getParameter()
Returns the parameters of this distribution.
virtual void setMaxDecel(double decel)
Sets a new value for maximal comfortable deceleration [m/s^2].
double computeChosenSpeedDeviation(std::mt19937 *rng, const double minDev=-1.) const
Computes and returns the speed deviation.
const MSVehicleType * myOriginalType
The original type.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
double height
This class' height.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
static double gDefaultEmergencyDecel
encoding of the string-option default.emergencydecel
Structure representing possible vehicle parameter.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
SubParams cfParameter
Car-following parameter.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
static double getDefaultDecel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default deceleration for the given vehicle class This needs to be a function because the ...
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
SUMOVTypeParameter myParameter
the parameter container
double minGap
This class' free space in front of the vehicle itself.
The original Krauss (1998) car-following model and parameter.
The ACC car-following model.
void setLength(const double &length)
Set a new value for this type's length.
double width
This class' width.
double getMinGap() const
Get the free space in front of vehicles of this class.
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
virtual void setMaxAccel(double accel)
Sets a new value for maximum acceleration [m/s^2].
double getCFParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
double maxSpeed
The vehicle type's maximum speed [m/s].
void setDecel(double decel)
Set a new value for this type's deceleration.
A set of automatic Cruise Controllers, including classic Cruise Control (CC), Adaptive Cruise Control...
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
const int VTYPEPARS_SPEEDFACTOR_SET
render as a (city) rail without locomotive
void setDefaultProbability(const double &prob)
Set a new value for this type's default probability.
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const =0
Duplicates the car-following model.
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
static SUMOTime gActionStepLength
default value for the interval between two action points for MSVehicle (defaults to DELTA_T)
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
The Intelligent Driver Model (IDM) car-following model.
double myCachedActionStepLengthSecs
the vtypes actionsStepLength in seconds (cached because needed very often)
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
void setSpeedDeviation(const double &dev)
Set a new value for this type's speed deviation.
static double getDefaultEmergencyDecel(const SUMOVehicleClass vc, double decel, double defaultOption)
Returns the default emergency deceleration for the given vehicle class This needs to be a function be...
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
LateralAlignment latAlignment
The vehicles desired lateral alignment.
std::string id
The vehicle type's id.
static MSVehicleType * build(SUMOVTypeParameter &from)
Builds the microsim vehicle type described by the given parameter.
double getLength() const
Get vehicle's length [m].
The original Krauss (1998) car-following model and parameter.
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
void resetActionOffset(const SUMOTime timeUntilNextAction=0)
Resets the action offset for the vehicle.
static int myNextIndex
next value for the running index
The Wiedemann Model car-following model.
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
const int VTYPEPARS_HEIGHT_SET
render as a semi-trailer transport vehicle ("Sattelschlepper")
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
car-following model by B. Kerner
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
The class responsible for building and deletion of vehicles.
MSCFModel * myCarFollowModel
instance of the car following model.
render as a transport vehicle with one trailer
const int VTYPEPARS_LENGTH_SET
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_SHAPE_SET
double getDefaultProbability() const
Get the default probability of this vehicle type.
const int VTYPEPARS_WIDTH_SET
SUMOVehicleClass vehicleClass
The vehicle's class.
const int VTYPEPARS_IMPATIENCE_SET
const int VTYPEPARS_MAXSPEED_SET
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
void setImpatience(const double impatience)
Set a new value for this type's impatience.
void setTau(double tau)
Set a new value for this type's headway.
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
void setImperfection(double imperfection)
Set a new value for this type's imperfection.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
const int VTYPEPARS_VEHICLECLASS_SET
double minGapLat
The vehicle type's minimum lateral gap [m].
Representation of a vehicle in the micro simulation.
Scalable model based on Krauss by Peter Wagner.