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