57 bool abortCreation =
true;
63 return handleError(hardFail, abortCreation,
"Invalid flow id '" +
id +
"'.");
69 const bool hasXPH = hasVPH || hasPPH;
74 if (hasPeriod && hasXPH) {
78 "' has to be given in the definition of flow '" +
id +
"'.");
80 if (hasPeriod && hasProb) {
84 "' has to be given in the definition of flow '" +
id +
"'.");
86 if (hasProb && hasXPH) {
90 "' has to be given in the definition of flow '" +
id +
"'.");
92 if (hasPeriod || hasXPH || hasProb) {
93 if (hasEnd && hasNumber) {
100 "' are allowed in flow '" +
id +
"'.");
109 "' is needed in flow '" +
id +
"'.");
134 if (ok && vph <= 0) {
137 "Invalid repetition rate in the definition of "
138 + std::string(hasVPH ?
"flow" :
"personFlow") +
" '" +
id +
"'.");
140 if (ok && vph != 0) {
149 return handleError(hardFail, abortCreation,
"Invalid repetition probability in the definition of flow '" +
id +
"'.");
152 ret->
depart = beginDefault;
156 if (ok && ret->
depart < 0) {
158 return handleError(hardFail, abortCreation,
"Negative begin time in the definition of flow '" +
id +
"'.");
167 }
else if ((endDefault >=
TIME2STEPS(9223372036854773) || endDefault < 0)
169 && (!hasNumber || (!hasProb && !hasPeriod && !hasXPH))) {
170 WRITE_WARNING(
"Undefined end for flow '" +
id +
"', defaulting to 24hour duration.");
175 return handleError(hardFail, abortCreation,
"Flow '" +
id +
"' ends before its begin time.");
181 WRITE_WARNING(
"Flow '" +
id +
"' has 0 vehicles; will skip it.");
185 return handleError(hardFail, abortCreation,
"Negative repetition number in the definition of flow '" +
id +
"'.");
199 return handleError(hardFail, abortCreation,
"Invalid repetition rate in the definition of flow '" +
id +
"'.");
211 return handleError(hardFail, abortCreation,
"Flow cannot be created");
227 std::string id, errorMsg;
236 if (optionalID || !
id.empty()) {
284 }
else if (
id.empty()) {
288 WRITE_ERROR(
"Invalid " +
toString(element) +
" id '" +
id +
"'. Contains invalid characters.");
302 bool abortCreation =
true;
460 if (personNumber >= 0) {
470 if (containerNumber >= 0) {
480 if (speedFactor > 0) {
498 bool abortCreation =
true;
570 handleError(hardFail, abortCreation,
"Invalid speed distribution when parsing vType '" + vtype->
id +
"' (" + error +
")");
595 bool okString =
true;
597 vtype->
impatience = -std::numeric_limits<double>::max();
599 bool okDouble =
true;
614 vtype->
width = width;
661 vtype->
color = color;
671 if (defaultProbability < 0) {
682 if (lcmS ==
"JE2013") {
683 WRITE_WARNING(
"Lane change model 'JE2013' is deprecated. Using default model instead.");
690 handleError(hardFail, abortCreation,
"Unknown lane change model '" + lcmS +
"' when parsing vType '" + vtype->
id +
"'");
700 handleError(hardFail, abortCreation,
"Unknown car following model '" + cfmValue +
"' when parsing vType '" + vtype->
id +
"'");
707 if (personCapacity < 0) {
719 if (containerCapacity < 0) {
731 if (boardingDuration < 0) {
743 if (loadingDuration < 0) {
755 if (maxSpeedLat <= 0) {
782 handleError(hardFail, abortCreation,
"Unknown lateral alignment '" + alignS +
"' when parsing vType '" + vtype->
id +
"'");
791 handleError(hardFail, abortCreation,
"Invalid manoeuver angle times map for vType '" + vtype->
id +
"'");
797 handleError(hardFail, abortCreation,
"Invalid parsing embedded VType");
801 handleError(hardFail, abortCreation,
"Invalid Lane Change Model Parameters");
805 handleError(hardFail, abortCreation,
"Invalid Junction Model Parameters");
811 if (!abortCreation) {
832 std::map<int, std::pair<SUMOTime, SUMOTime>> angleTimesMap;
833 int tripletCount = 0;
837 if (pos.
size() != 3) {
839 throw ProcessError(
"manoeuverAngleTimes format for vType '" + vtype.
id +
"' " + atm +
" contains an invalid triplet.");
841 WRITE_ERROR(
"manoeuverAngleTimes format for vType '" + vtype.
id +
"' " + atm +
" contains an invalid triplet.");
851 angleTimesMap.insert((std::pair<
int, std::pair<SUMOTime, SUMOTime>>(angle, std::pair< SUMOTime, SUMOTime>(t1, t2))));
853 WRITE_ERROR(
"Triplet '" + st.
get(tripletCount) +
"' for vType '" + vtype.
id +
"' manoeuverAngleTimes cannot be parsed as 'int double double'");
859 if (angleTimesMap.size() > 0) {
861 for (std::pair<
int, std::pair<SUMOTime, SUMOTime>> angleTime : angleTimesMap) {
864 angleTimesMap.clear();
875 bool abortCreation =
true;
876 CFAttrMap::const_iterator cf_it = allowedCFM.find(element);
878 if (cf_it == allowedCFM.end()) {
880 handleError(hardFail, abortCreation,
"Unknown car following model " +
toString(element) +
" when parsing vType '" + into.
id +
"'");
882 handleError(hardFail, abortCreation,
"Unknown car following model when parsing vType '" + into.
id +
"'");
893 for (
const auto& it : cf_it->second) {
896 std::string parsedCFMAttribute = attrs.
get<std::string>(it, into.
id.c_str(), ok);
903 }
else if (hardFail) {
904 throw ProcessError(
"Invalid train type '" + parsedCFMAttribute +
"' used in Car-Following-Attribute " +
toString(it));
906 WRITE_ERROR(
"Invalid train type '" + parsedCFMAttribute +
"' used in Car-Following-Attribute " +
toString(it));
910 int CFMIntAttribute = -1;
917 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Cannot be parsed to int");
919 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Cannot be parsed to int");
924 if (CFMIntAttribute <= 0) {
927 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Must be greater than 0");
929 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Must be greater than 0");
939 double CFMDoubleAttribute = -1;
946 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
948 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
964 if (CFMDoubleAttribute <= 0) {
967 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Must be greater than 0");
969 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Must be greater than 0");
978 if ((CFMDoubleAttribute < 0) || (CFMDoubleAttribute > 1)) {
981 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Only values between [0-1] are allowed");
983 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Only values between [0-1] are allowed");
993 WRITE_WARNING(
"Value of tau=" + parsedCFMAttribute +
" in car following model '" +
994 toString(into.
cfModel) +
"' lower than simulation step size may cause collisions");
1013 std::set<SumoXMLAttr> kraussParams;
1023 std::set<SumoXMLAttr> allParams(kraussParams);
1025 std::set<SumoXMLAttr> kraussXParams(kraussParams);
1032 allParams.insert(kraussXParams.begin(), kraussXParams.end());
1034 std::set<SumoXMLAttr> smartSKParams;
1047 allParams.insert(smartSKParams.begin(), smartSKParams.end());
1049 std::set<SumoXMLAttr> daniel1Params;
1062 allParams.insert(daniel1Params.begin(), daniel1Params.end());
1064 std::set<SumoXMLAttr> pwagParams;
1074 allParams.insert(pwagParams.begin(), pwagParams.end());
1076 std::set<SumoXMLAttr> idmParams;
1085 allParams.insert(idmParams.begin(), idmParams.end());
1087 std::set<SumoXMLAttr> idmmParams;
1097 allParams.insert(idmmParams.begin(), idmmParams.end());
1099 std::set<SumoXMLAttr> bkernerParams;
1108 allParams.insert(bkernerParams.begin(), bkernerParams.end());
1110 std::set<SumoXMLAttr> wiedemannParams;
1118 allParams.insert(wiedemannParams.begin(), wiedemannParams.end());
1120 std::set<SumoXMLAttr> w99Params;
1133 allParams.insert(w99Params.begin(), w99Params.end());
1135 std::set<SumoXMLAttr> railParams;
1143 allParams.insert(railParams.begin(), railParams.end());
1145 std::set<SumoXMLAttr> ACCParams;
1159 allParams.insert(ACCParams.begin(), ACCParams.end());
1161 std::set<SumoXMLAttr> CACCParams;
1182 allParams.insert(CACCParams.begin(), CACCParams.end());
1184 std::set<SumoXMLAttr> ccParams;
1207 allParams.insert(ccParams.begin(), ccParams.end());
1219 std::set<SumoXMLAttr> lc2013Params;
1238 std::set<SumoXMLAttr> sl2015Params = lc2013Params;
1249 std::set<SumoXMLAttr> noParams;
1258 for (
const auto& it : allowed) {
1261 std::string parsedLCMAttribute = attrs.
get<std::string>(it, into.
id.c_str(), ok);
1263 double LCMAttribute = -1;
1270 throw ProcessError(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
1272 WRITE_ERROR(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
1290 if (LCMAttribute < 0) {
1293 throw ProcessError(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Must be equal or greater than 0");
1295 WRITE_ERROR(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Must be equal or greater than 0");
1305 if (LCMAttribute <= 0) {
1308 throw ProcessError(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Must be greater than 0");
1310 WRITE_ERROR(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Must be greater than 0");
1346 std::string parsedJMAttribute = attrs.
get<std::string>(it, into.
id.c_str(), ok);
1348 double JMAttribute = -1;
1355 throw ProcessError(
"Invalid Junction-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
1357 WRITE_ERROR(
"Invalid Junction-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
1361 if (ok && (JMAttribute != -1)) {
1365 if ((JMAttribute < 0) || (JMAttribute > 1)) {
1368 throw ProcessError(
"Invalid Junction-Model Attribute " +
toString(it) +
". Only values between [0-1] are allowed");
1370 WRITE_ERROR(
"Invalid Junction-Model Attribute " +
toString(it) +
". Only values between [0-1] are allowed");
1375 if (JMAttribute < 0) {
1378 throw ProcessError(
"Invalid Junction-Model Attribute " +
toString(it) +
". Must be equal or greater than 0");
1380 WRITE_ERROR(
"Invalid Junction-Model Attribute " +
toString(it) +
". Must be equal or greater than 0");
1400 if (vclassS ==
"") {
1406 if (realName != vclassS) {
1407 WRITE_WARNING(
"The vehicle class '" + vclassS +
"' for " + attrs.
getObjectType() +
" '" +
id +
"' is deprecated, use '" + realName +
"' instead.");
1424 if (realName != vclassS) {
1425 WRITE_WARNING(
"The shape '" + vclassS +
"' for " + attrs.
getObjectType() +
" '" +
id +
"' is deprecated, use '" + realName +
"' instead.");
1451 result = maxPos / 2.;
1464 std::stringstream ss;
1465 ss <<
"The parameter action-step-length must be a non-negative multiple of the simulation step-length. Ignoring given value (="
1470 }
else if (result %
DELTA_T != 0) {
1471 std::stringstream ss;
1474 if (fabs(given * 1000. -
double(result)) > NUMERICAL_EPS) {
1475 ss <<
"The parameter action-step-length must be a non-negative multiple of the simulation step-length. Parsing given value ("
1476 << given <<
" s.) to the adjusted value "
1488 abortCreation =
true;
#define WRITE_WARNING(msg)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
const int VTYPEPARS_MAXSPEED_SET
const int VTYPEPARS_MANEUVER_ANGLE_TIMES_SET
const int VTYPEPARS_PERSON_CAPACITY
const int VTYPEPARS_HEIGHT_SET
const int VTYPEPARS_VEHICLECLASS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_SPEEDFACTOR_SET
const int VTYPEPARS_BOARDING_DURATION
const int VTYPEPARS_IMPATIENCE_SET
const int VTYPEPARS_LATALIGNMENT_SET
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_OSGFILE_SET
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
const int VTYPEPARS_MINGAP_SET
const int VTYPEPARS_IMGFILE_SET
const int VTYPEPARS_SHAPE_SET
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
const int VTYPEPARS_LOADING_DURATION
const int VTYPEPARS_CONTAINER_CAPACITY
const int VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_PROBABILITY_SET
const int VTYPEPARS_CAR_FOLLOW_MODEL
const int VTYPEPARS_MINGAP_LAT_SET
const int VTYPEPARS_WIDTH_SET
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
const std::string DEFAULT_PEDTYPE_ID
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
const std::string DEFAULT_CONTAINERTYPE_ID
const int VEHPARS_DEPARTEDGE_SET
const int VEHPARS_PROB_SET
const int VEHPARS_VPH_SET
const int VEHPARS_END_SET
const int VEHPARS_ROUTE_SET
const int VEHPARS_COLOR_SET
DepartLaneDefinition
Possible ways to choose a lane on depart.
const int VEHPARS_TO_TAZ_SET
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
DepartPosDefinition
Possible ways to choose the departure position.
const int VEHPARS_SPEEDFACTOR_SET
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
const int VEHPARS_DEPARTPOS_SET
const int VEHPARS_CONTAINER_NUMBER_SET
const int VEHPARS_ARRIVALLANE_SET
DepartSpeedDefinition
Possible ways to choose the departure speed.
const int VEHPARS_DEPARTLANE_SET
const int VEHPARS_ARRIVALPOSLAT_SET
DepartEdgeDefinition
Possible ways to choose the departure edge.
const int VEHPARS_FROM_TAZ_SET
const int VEHPARS_NUMBER_SET
const int VEHPARS_ARRIVALSPEED_SET
const int VEHPARS_FORCE_REROUTE
ArrivalPosDefinition
Possible ways to choose the arrival position.
@ RANDOM
The arrival position is chosen randomly.
@ MAX
The maximum arrival position is used.
@ CENTER
Half the road length.
const int VEHPARS_LINE_SET
const int VEHPARS_PERSON_NUMBER_SET
const int VEHPARS_DEPARTSPEED_SET
const int VEHPARS_PERIOD_SET
ArrivalPosLatDefinition
Possible ways to choose the departure position.
const int VEHPARS_VTYPE_SET
const int VEHPARS_ARRIVALPOS_SET
const int VEHPARS_DEPARTPOSLAT_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_VTYPE
description of a vehicle type
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_CF_KRAUSS_PLUS_SLOPE
@ SUMO_TAG_CF_PWAGNER2009
@ SUMO_TAG_CF_KRAUSS_ORIG1
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_GCC_GAIN_GAP_DOT_CACC
@ SUMO_ATTR_CF_CC_FLATBED_KP
@ SUMO_ATTR_GCC_GAIN_SPEED
@ SUMO_ATTR_EMISSIONCLASS
@ SUMO_ATTR_JM_IGNORE_FOE_SPEED
@ SUMO_ATTR_CF_CC_FLATBED_D
@ SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME
@ SUMO_ATTR_LCA_COOPERATIVE_SPEED
@ SUMO_ATTR_CF_CC_FLATBED_KA
@ SUMO_ATTR_CF_CC_PLOEG_KP
@ SUMO_ATTR_CF_WIEDEMANN_SECURITY
@ SUMO_ATTR_LCA_ASSERTIVE
@ SUMO_ATTR_LCA_LANE_DISCIPLINE
@ SUMO_ATTR_CF_IDMM_ADAPT_TIME
@ SUMO_ATTR_LANE_CHANGE_MODEL
@ SUMO_ATTR_CF_KERNER_PHI
@ SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE
@ SUMO_ATTR_GC_GAIN_SPACE
@ SUMO_ATTR_JM_STOPLINE_GAP
@ SUMO_ATTR_DEPARTPOS_LAT
@ SUMO_ATTR_CA_GAIN_GAP_CACC
@ SUMO_ATTR_LCA_LOOKAHEADLEFT
@ SUMO_ATTR_APPARENTDECEL
@ SUMO_ATTR_GC_GAIN_GAP_DOT_CACC
@ SUMO_ATTR_LCA_SPEEDGAIN_PARAM
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_CF_CC_PLOEG_H
@ SUMO_ATTR_LCA_IMPATIENCE
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_LCA_COOPERATIVE_ROUNDABOUT
@ SUMO_ATTR_CA_GAIN_GAP_DOT_CACC
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
@ SUMO_ATTR_HEADWAY_TIME_CACC_TO_ACC
@ SUMO_ATTR_CONTAINER_NUMBER
@ SUMO_ATTR_CA_GAIN_SPACE
@ SUMO_ATTR_LOADING_DURATION
@ SUMO_ATTR_LCA_SPEEDGAIN_LOOKAHEAD
@ SUMO_ATTR_LCA_MAXSPEEDLATFACTOR
@ SUMO_ATTR_MANEUVER_ANGLE_TIMES
Class specific timing values for vehicle manoeuvering through angle ranges.
@ SUMO_ATTR_CF_CC_CCACCEL
@ SUMO_ATTR_CF_PWAGNER2009_TAULAST
@ SUMO_ATTR_CF_CC_PLOEG_KD
@ SUMO_ATTR_GC_GAIN_GAP_CACC
@ SUMO_ATTR_CAR_FOLLOW_MODEL
@ SUMO_ATTR_LCA_MAXSPEEDLATSTANDING
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
@ SUMO_ATTR_LCA_KEEPRIGHT_PARAM
@ SUMO_ATTR_JM_IGNORE_FOE_PROB
@ SUMO_ATTR_CONTAINER_CAPACITY
@ SUMO_ATTR_LCA_COOPERATIVE_PARAM
@ SUMO_ATTR_LCA_OPPOSITE_PARAM
@ SUMO_ATTR_CF_CC_CCDECEL
@ SUMO_ATTR_GCC_GAIN_SPACE
@ SUMO_ATTR_EMERGENCYDECEL
@ SUMO_ATTR_CF_CC_FLATBED_H
@ SUMO_ATTR_CF_CC_LANES_COUNT
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_LCA_SUBLANE_PARAM
@ SUMO_ATTR_JM_CROSSING_GAP
@ SUMO_ATTR_CF_IDM_STEPPING
@ SUMO_ATTR_CF_IDMM_ADAPT_FACTOR
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_CF_CC_CONSTSPACING
@ SUMO_ATTR_JM_SIGMA_MINOR
@ SUMO_ATTR_CA_GAIN_SPEED
@ SUMO_ATTR_PERSON_NUMBER
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_CF_PWAGNER2009_APPROB
@ SUMO_ATTR_LCA_OVERTAKE_RIGHT
@ SUMO_ATTR_ARRIVALPOS_LAT
@ SUMO_ATTR_LCA_ACCEL_LAT
@ SUMO_ATTR_LCA_STRATEGIC_PARAM
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_GC_GAIN_SPEED
@ SUMO_ATTR_GCC_GAIN_GAP_CACC
@ SUMO_ATTR_LCA_EXPERIMENTAL1
@ SUMO_ATTR_JM_DRIVE_RED_SPEED
@ SUMO_ATTR_LCA_TIME_TO_IMPATIENCE
@ SUMO_ATTR_JM_TIMEGAP_MINOR
@ SUMO_ATTR_CF_CC_FLATBED_KV
@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION
@ SUMO_ATTR_PERSONSPERHOUR
@ SUMO_ATTR_LCA_SPEEDGAINRIGHT
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void parse(const std::string &description, const bool hardFail)
Overwrite by parsable distribution description.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
bool isValid(std::string &error)
check whether the distribution is valid
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
static const RGBColor YELLOW
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
static double rand(std::mt19937 *rng=nullptr)
Returns a random real number in [0, 1)
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
const std::string & getObjectType() const
return the objecttype to which these attributes belong
virtual std::string getName(int attr) const =0
Converts the given attribute id into a man readable string.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
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 length
The physical vehicle length.
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
LateralAlignment latAlignment
The vehicles desired lateral alignment.
double minGap
This class' free space in front of the vehicle itself.
std::string imgFile
Image file for this class.
SUMOVehicleShape shape
This class' shape.
int personCapacity
The person capacity of the vehicle.
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
std::string osgFile
3D model file for this class
double maxSpeed
The vehicle type's maximum speed [m/s].
int parametersSet
Information for the router which parameter were set.
int containerCapacity
The container capacity of the vehicle.
SUMOTime boardingDuration
The time a person needs to board the vehicle.
double minGapLat
The vehicle type's minimum lateral gap [m].
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
std::string id
The vehicle type's id.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
SubParams lcParameter
Lane-changing parameter.
SubParams jmParameter
Junction-model parameter.
double impatience
The vehicle's impatience (willingness to obstruct others)
std::map< int, std::pair< SUMOTime, SUMOTime > > myManoeuverAngleTimes
Map of manoeuver angles versus the times (entry, exit) to execute the manoeuver.
LaneChangeModel lcModel
The lane-change model to use.
Structure representing possible vehicle parameter.
double departPosLat
(optional) The lateral position the vehicle shall depart from
double arrivalPosLat
(optional) The lateral position the vehicle shall arrive on
double repetitionProbability
The probability for emitting a vehicle per second.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color)
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
double departSpeed
(optional) The initial speed of the vehicle
SumoXMLTag tag
The vehicle tag.
std::string vtypeid
The vehicle's type id.
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
double speedFactor
individual speedFactor (overriding distribution from vType)
static bool parseArrivalLane(const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
Validates a given arrivalLane value.
static bool parseArrivalPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosLatDefinition &apd, std::string &error)
Validates a given arrivalPosLat value.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons)
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
RGBColor color
The vehicle's color, TraCI may change this.
double arrivalPos
(optional) The position the vehicle shall arrive on
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
std::string routeid
The vehicle's route id.
std::string id
The vehicle's id.
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error)
Validates a given depart value.
int departEdge
(optional) The initial edge within the route of the vehicle
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
static bool parseDepartPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosLatDefinition &dpd, std::string &error)
Validates a given departPosLat value.
DepartEdgeDefinition departEdgeProcedure
Information how the vehicle's initial edge shall be chosen.
std::string toTaz
The vehicle's destination zone (district)
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string &id, bool silent=false)
Interprets negative edge positions and fits them onto a given edge.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
std::string fromTaz
The vehicle's origin zone (district)
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
std::string line
The vehicle's line (mainly for public transport)
static bool parseDepartEdge(const std::string &val, const std::string &element, const std::string &id, int &edgeIndex, DepartEdgeDefinition &ded, std::string &error)
Validates a given departEdge value.
int containerNumber
The static number of containers in the vehicle when it departs.
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
static const CFAttrMap & getAllowedCFModelAttrs()
returns allowed attrs for each known CF-model (init on first use)
static SUMOVehicleParameter * handleError(const bool hardFail, bool &abortCreation, const std::string &message)
handle error loading SUMOVehicleParameter
static SUMOVTypeParameter * beginVTypeParsing(const SUMOSAXAttributes &attrs, const bool hardFail, const std::string &file)
Starts to parse a vehicle type.
static bool parseVTypeEmbedded(SUMOVTypeParameter &into, const SumoXMLTag element, const SUMOSAXAttributes &attrs, const bool hardFail, const bool fromVType=false)
Parses an element embedded in vtype definition.
std::map< SumoXMLTag, std::set< SumoXMLAttr > > CFAttrMap
Car-Following attributes map.
static std::string parseID(const SUMOSAXAttributes &attrs, const SumoXMLTag element)
parse ID
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
std::map< LaneChangeModel, std::set< SumoXMLAttr > > LCAttrMap
Lane-Change-Model attributes map.
static SUMOVehicleParameter * parseFlowAttributes(SumoXMLTag tag, const SUMOSAXAttributes &attrs, const bool hardFail, const SUMOTime beginDefault, const SUMOTime endDefault, bool isPerson=false)
Parses a flow's attributes.
static double parseWalkPos(SumoXMLAttr attr, const bool hardFail, const std::string &id, double maxPos, const std::string &val, std::mt19937 *rng=0)
parse departPos or arrivalPos for a walk
static void parseCommonAttributes(const SUMOSAXAttributes &attrs, const bool hardFail, SUMOVehicleParameter *ret, std::string element)
Parses attributes common to vehicles and flows.
static SUMOVehicleShape parseGuiShape(const SUMOSAXAttributes &attrs, const std::string &id)
Parses the vehicle class.
static bool parseJMParams(SUMOVTypeParameter &into, const SUMOSAXAttributes &attrs, const bool hardFail)
Parses junction model attributes.
static std::set< SumoXMLAttr > allowedJMAttrs
allowed attrs for the junction model
static SUMOVehicleClass parseVehicleClass(const SUMOSAXAttributes &attrs, const std::string &id)
Parses the vehicle class.
static bool parseAngleTimesMap(SUMOVTypeParameter &vtype, const std::string, const bool hardFail)
Parse string containing AngleTimes triplets (angle, entry time, exit time)
static bool parseLCParams(SUMOVTypeParameter &into, LaneChangeModel model, const SUMOSAXAttributes &attrs, const bool hardFail)
Parses lane change model attributes.
static LCAttrMap allowedLCModelAttrs
allowed attrs for each known LC-model
static SUMOVehicleParameter * parseVehicleAttributes(int element, const SUMOSAXAttributes &attrs, const bool hardFail, const bool optionalID=false, const bool skipDepart=false)
Parses a vehicle's attributes.
static CFAttrMap allowedCFModelAttrs
allowed attrs for each known CF-model
static StringBijection< SumoXMLTag > CarFollowModels
car following models
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
static StringBijection< TrainType > TrainTypes
train types
static StringBijection< int > Tags
The names of SUMO-XML elements for use in netbuild.
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
T get(const std::string &str) const
int size() const
returns the number of existing substrings
std::string get(int pos) const
returns the item at the given position
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...