178 myParameter.latAlignmentOffset = latAlignmentOffset;
229 assert(actionStepLength >= 0);
232 if (
myParameter.actionStepLength == actionStepLength) {
253 if (resetActionOffset) {
287 myParameter.parkingBadges.assign(badges.begin(), badges.end());
336 WRITE_WARNINGF(
TL(
"The vType '%' has a 'mass' attribute and a 'vehicleMass' parameter. The 'mass' attribute will take precedence."), from.
id);
338 WRITE_WARNINGF(
TL(
"The vType '%' has a 'vehicleMass' parameter, which is deprecated. Please use the 'mass' attribute (for the empty mass) and the 'loading' parameter, if needed."), from.
id);
349 if (emergencyDecel < decel) {
352 if (emergencyDecel < apparentDecel) {
353 WRITE_WARNINGF(
TL(
"Value of 'emergencyDecel' (%) is lower than 'apparentDecel' (%) for vType '%' may cause collisions."),
toString(emergencyDecel),
toString(apparentDecel), from.
id);
440 std::string singular = persistent ?
"" :
TL(
"singular ");
455 <<
" This may lead to collisions. (This warning is only issued once per vehicle type).";
462 std::string warning2;
464 warning2 =
" Setting it now to avoid collisions.";
467 warning2 =
" This may cause collisions.";
469 WRITE_WARNINGF(
"Action step length '%' is used for vehicle type '%' but step-method.ballistic was not set." + warning2
475 WRITE_WARNINGF(
TL(
"Value of tau=% in vehicle type '%' lower than simulation step size may cause collisions."),
481 WRITE_WARNINGF(
TL(
"Vehicle class '%' of vType '%' is set as ignored by option --meso-ignore-lanes-by-vclass to ensure default vehicle capacity. Set option --meso-lane-queue for multi-modal meso simulation"),
487 ||
myParameter.getDouble(
"device.battery.probability", -1.) == 1.
489 myParameter.emissionClass = PollutantsInterface::getClassByName(
"Energy");
491 WRITE_MESSAGEF(
TL(
"The battery device is active for vType '%' but no emission class is set. The emission class Energy/unknown will be used, please consider setting an explicit emission class!"),
518 emergencyDecel =
myOriginalType->getCarFollowModel().getEmergencyDecel();
527 apparentDecel =
myOriginalType->getCarFollowModel().getApparentDecel();
622 imperfection =
myOriginalType->getCarFollowModel().getImperfection();
#define WRITE_WARNINGF(...)
#define WRITE_MESSAGEF(...)
#define WRITE_WARNING(msg)
const std::string invalid_return< std::string >::value
const long long int VTYPEPARS_SHAPE_SET
const long long int VTYPEPARS_WIDTH_SET
const long long int VTYPEPARS_ACTIONSTEPLENGTH_SET
const long long int VTYPEPARS_MAXSPEED_LAT_SET
const long long int VTYPEPARS_MAXSPEED_SET
const long long int VTYPEPARS_EMISSIONCLASS_SET
const long long int VTYPEPARS_LATALIGNMENT_SET
const long long int VTYPEPARS_COLOR_SET
const long long int VTYPEPARS_SPEEDFACTOR_SET
const long long int VTYPEPARS_MINGAP_SET
const long long int VTYPEPARS_PROBABILITY_SET
const long long int VTYPEPARS_HEIGHT_SET
const long long int VTYPEPARS_PARKING_BADGES_SET
const long long int VTYPEPARS_MASS_SET
const long long int VTYPEPARS_BOARDING_DURATION
LatAlignmentDefinition
Possible ways to choose the lateral alignment, i.e., how vehicles align themselves within their lane.
const long long int VTYPEPARS_VEHICLECLASS_SET
const long long int VTYPEPARS_IMPATIENCE_SET
const long long int VTYPEPARS_LENGTH_SET
const long long int VTYPEPARS_MINGAP_LAT_SET
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleShape
Definition of vehicle classes to differ between different appearances.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_CF_KRAUSS_PLUS_SLOPE
@ SUMO_TAG_CF_PWAGNER2009
@ SUMO_TAG_CF_KRAUSS_ORIG1
@ SUMO_ATTR_APPARENTDECEL
@ SUMO_ATTR_LCA_CONTRIGHT
@ SUMO_ATTR_EMERGENCYDECEL
double roundDecimal(double x, int precision)
round to the given number of decimal digits
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An upper class for objects with additional parameters.
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 Extended Intelligent Driver Model (EIDM) car-following model.
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 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)
Inserts vehicles into the network when their departure time is reached.
void updateScale(const std::string vtypeid)
updates the flow scale value to keep track of TraCI-induced change
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSInsertionControl & getInsertionControl()
Returns the insertion control.
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.
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
double myCachedActionStepLengthSecs
the vtypes actionsStepLength in seconds (cached because needed very often)
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
double getMaxSpeed() const
Get vehicle's (technical) maximum speed [m/s].
const int myIndex
the running index
void setGUIShape(SUMOVehicleShape shape)
Set a new value for this type's gui shape.
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...
const std::string & getID() const
Returns the name of the vehicle type.
void setParkingBadges(const std::vector< std::string > &badges)
Set a new value for parking access rights of this type.
MSCFModel * myCarFollowModel
instance of the car following model.
void setDesAccelProfile(std::vector< std::pair< double, double > > accelProfile)
Set a new value for this type's desired acceleration profile.
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
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
bool myWarnedStepLengthTauOnce
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
void setBoardingDuration(SUMOTime duration, bool isPerson=true)
Set a new value for this type's boardingDuration.
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.
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.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version).
void setWidth(const double &width)
Set a new value for this type's width.
void setLcContRight(const std::string &value)
Set lcContRight (which is the only lc-attribute not used within the laneChange model).
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 MSVehicleType * build(SUMOVTypeParameter &from, const std::string &fileName="")
Builds the microsim vehicle type described by the given parameter.
void setPreferredLateralAlignment(const LatAlignmentDefinition &latAlignment, double latAlignmentOffset=0.0)
Set vehicle's preferred lateral alignment.
static int myNextIndex
next value for the running index
void setTau(double tau)
Set a new value for this type's headway.
void setMaxAccelProfile(std::vector< std::pair< double, double > > accelProfile)
Set a new value for this type's maximum acceleration profile.
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].
void setMass(double mass)
Set a new value for this type's mass.
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.
const SUMOVTypeParameter & getParameter() const
double computeChosenSpeedDeviation(SumoRNG *rng, const double minDev=-1.) const
Computes and returns the speed deviation.
virtual ~MSVehicleType()
Destructor.
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
const EnergyParams myEnergyParams
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...
void setScale(double value)
Set traffic scaling factor.
static OptionsCont & getOptions()
Retrieves the options.
bool hasParameter(const std::string &key) const
Returns whether the parameter is set.
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
Structure representing possible vehicle parameter.
bool wasSet(long long 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 ...
void initRailVisualizationParameters(const std::string fileName="")
init Rail Visualization Parameters
long long int parametersSet
Information for the router which parameter were set.
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...
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.
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.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter