65 : myParameter(parameter), myWarnedActionStepLengthTauOnce(false), myIndex(myNextIndex++), myCarFollowModel(0), myOriginalType(0) {
203 assert(actionStepLength >= 0.);
227 if (resetActionOffset) {
292 if (emergencyDecel < decel) {
293 WRITE_WARNING(
"Value of 'emergencyDecel' is should be higher than 'decel' for vType '" + from.
id +
"'.");
295 if (emergencyDecel < apparentDecel) {
296 WRITE_WARNING(
"Value of 'emergencyDecel' lower than 'apparentDecel' for vType '" + from.
id +
"' may cause collisions.");
384 std::string singular = persistent ?
"" :
"singular ";
399 <<
" This may lead to collisions. (This warning is only issued once per vehicle type).";
const int VTYPEPARS_MAXSPEED_SET
The Wiedemann Model car-following model.
const int VTYPEPARS_MINGAP_SET
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
Representation of a vehicle in the micro simulation.
const int VTYPEPARS_LATALIGNMENT_SET
car-following model by B. Kerner
double impatience
The vehicle's impatience (willingness to obstruct others)
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
void setDefaultProbability(const double &prob)
Set a new value for this type's default probability.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
SUMOVehicleShape shape
This class' shape.
Structure representing possible vehicle parameter.
const int VTYPEPARS_MINGAP_LAT_SET
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const =0
Duplicates the car-following model.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
The Intelligent Driver Model (IDM) car-following model.
Krauss car-following model, changing accel and speed by slope.
SUMOVehicleClass vehicleClass
The vehicle's class.
The original Krauss (1998) car-following model and parameter.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
const MSVehicleType * myOriginalType
The original type.
void setLength(const double &length)
Set a new value for this type's length.
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
const int VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_PROBABILITY_SET
MSVehicleType * duplicateType(const std::string &id, bool persistent) const
Duplicates the microsim vehicle type giving the newly created type the given id.
static MSVehicleType * build(SUMOVTypeParameter &from)
Builds the microsim vehicle type described by the given parameter.
LateralAlignment
Numbers representing special SUMO-XML-attribute values Information how vehicles align themselves with...
#define WRITE_WARNING(msg)
The car-following model and parameter.
static double getDefaultAccel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default acceleration for the given vehicle class This needs to be a function because the ...
double height
This class' height.
bool isVehicleSpecific() const
Returns whether this type belongs to a single vehicle only (was modified)
static double getDefaultImperfection(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle c...
double getDefaultProbability() const
Get the default probability of this vehicle type.
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
bool wasSet(int what) const
Returns whether the given parameter was set.
double maxSpeed
The vehicle type's maximum speed [m/s].
double width
This class' width.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
void check()
Checks whether vehicle type parameters may be problematic (Currently, only the value for the action s...
MSVehicleType * buildSingularType(const std::string &id) const
Duplicates the microsim vehicle type giving the newly created type the given id, marking it as vehicl...
The original Krauss (1998) car-following model and parameter.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
void setHeight(const double &height)
Set a new value for this type's height.
virtual ~MSVehicleType()
Destructor.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
void resetActionOffset(const SUMOTime timeUntilNextAction=0)
Resets the action offset for the vehicle.
void setImpatience(const double impatience)
Set a new value for this type's impatience.
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 setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
double getMinGap() const
Get the free space in front of vehicles of this class.
void setSpeedDeviation(const double &dev)
Set a new value for this type's speed deviation.
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
const int VTYPEPARS_SPEEDFACTOR_SET
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
Scalable model based on Krauss by Peter Wagner.
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
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.
int parametersSet
Information for the router which parameter were set.
The original Krauss (1998) car-following model and parameter.
SUMOVTypeParameter myParameter
the parameter container
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
MSCFModel * myCarFollowModel
instance of the car following model.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
static SUMOTime gActionStepLength
default value for the interval between two action points for MSVehicle (defaults to DELTA_T) ...
double minGapLat
The vehicle type's minimum lateral gap [m].
std::string getCFParamString(const SumoXMLAttr attr, const std::string defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
static int myNextIndex
next value for the running index
const std::string & getID() const
Returns the name of the vehicle type.
void setWidth(const double &width)
Set a new value for this type's width.
std::string id
The vehicle type's id.
void updateActionOffset(const SUMOTime oldActionStepLength, const SUMOTime newActionStepLength)
Process an updated action step length value (only affects the vehicle's action offset, The actionStepLength is stored in the (singular) vtype)
double getLength() const
Get vehicle's length [m].
MSVehicleType(const SUMOVTypeParameter ¶meter)
Constructor.
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
LateralAlignment latAlignment
The vehicles desired lateral alignment.
SUMOTime actionStepLength
The vehicle type's default actionStepLength [ms], i.e. the interval between two control actions...
double minGap
This class' free space in front of the vehicle itself.
const int VTYPEPARS_HEIGHT_SET
void setColor(const RGBColor &color)
Set a new value for this type's color.
double sample(std::mt19937 *which=0) const
Draw a sample of the distribution.
bool myWarnedActionStepLengthTauOnce
Indicator whether the user was already warned once about an action step length larger than the desire...
const int VTYPEPARS_WIDTH_SET
double getImpatience() const
Returns this type's impatience.
The class responsible for building and deletion of vehicles.
double computeChosenSpeedDeviation(std::mt19937 *rng, const double minDev=-1.) const
Computes and returns the speed deviation.
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
Krauss car-following model, with acceleration decrease and faster start.
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_VEHICLECLASS_SET
Krauss car-following model, changing accel and speed by slope.
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_COLOR_SET
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street...
const int VTYPEPARS_SHAPE_SET
double length
The physical vehicle length.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
double myCachedActionStepLengthSecs
the vtypes actionsStepLength in seconds (cached because needed very often)
const int VTYPEPARS_IMPATIENCE_SET