 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
58 bool abortCreation =
true;
64 return handleError(hardFail, abortCreation,
"Invalid flow id '" +
id +
"'.");
70 "' has to be given in the definition of flow '" +
id +
"'.");
76 "' has to be given in the definition of flow '" +
id +
"'.");
82 "' has to be given in the definition of flow '" +
id +
"'.");
93 "' are allowed in flow '" +
id +
"'.");
102 "' is needed in flow '" +
id +
"'.");
130 if (ok && vph <= 0) {
132 return handleError(hardFail, abortCreation,
"Invalid repetition rate in the definition of flow '" +
id +
"'.");
134 if (ok && vph != 0) {
141 if (ok && vph <= 0) {
143 return handleError(hardFail, abortCreation,
"Invalid repetition rate in the definition of personFlow '" +
id +
"'.");
145 if (ok && vph != 0) {
154 return handleError(hardFail, abortCreation,
"Invalid repetition probability in the definition of flow '" +
id +
"'.");
158 ret->
depart = beginDefault;
162 if (ok && ret->
depart < 0) {
164 return handleError(hardFail, abortCreation,
"Negative begin time in the definition of flow '" +
id +
"'.");
175 (endDefault >=
TIME2STEPS(9223372036854773) || endDefault < 0)) {
176 WRITE_WARNING(
"Undefined end for flow '" +
id +
"', defaulting to 24hour duration.");
181 return handleError(hardFail, abortCreation,
"Flow '" +
id +
"' ends before its begin time.");
187 WRITE_WARNING(
"Flow '" +
id +
"' has 0 vehicles; will skip it.");
191 return handleError(hardFail, abortCreation,
"Negative repetition number in the definition of flow '" +
id +
"'.");
205 return handleError(hardFail, abortCreation,
"Invalid repetition rate in the definition of flow '" +
id +
"'.");
217 return handleError(hardFail, abortCreation,
"Flow cannot be created");
233 std::string id, errorMsg;
242 if (optionalID || !
id.empty()) {
268 }
else if (ret->
routeid.empty()) {
301 }
else if (
id.empty()) {
305 WRITE_ERROR(
"Invalid " +
toString(element) +
" id '" +
id +
"'. Contains invalid characters.");
319 bool abortCreation =
true;
464 if (personNumber >= 0) {
474 if (containerNumber >= 0) {
484 if (speedFactor > 0) {
502 bool abortCreation =
true;
574 handleError(hardFail, abortCreation,
"Invalid speed distribution when parsing vType '" + vtype->
id +
"' (" + error +
")");
603 vtype->
impatience = -std::numeric_limits<double>::max();
619 vtype->
width = width;
666 vtype->
color = color;
676 if (defaultProbability < 0) {
687 if (lcmS ==
"JE2013") {
688 WRITE_WARNING(
"Lane change model 'JE2013' is deprecated. Using default model instead.");
695 handleError(hardFail, abortCreation,
"Unknown lane change model '" + lcmS +
"' when parsing vType '" + vtype->
id +
"'");
705 handleError(hardFail, abortCreation,
"Unknown car following model '" + cfmValue +
"' when parsing vType '" + vtype->
id +
"'");
712 if (personCapacity < 0) {
724 if (containerCapacity < 0) {
736 if (boardingDuration < 0) {
748 if (loadingDuration < 0) {
760 if (maxSpeedLat <= 0) {
787 handleError(hardFail, abortCreation,
"Unknown lateral alignment '" + alignS +
"' when parsing vType '" + vtype->
id +
"'");
796 handleError(hardFail, abortCreation,
"Invalid manoeuver angle times map for vType '" + vtype->
id +
"'");
802 handleError(hardFail, abortCreation,
"Invalid parsing embedded VType");
806 handleError(hardFail, abortCreation,
"Invalid Lane Change Model Parameters");
810 handleError(hardFail, abortCreation,
"Invalid Junction Model Parameters");
816 if (!abortCreation) {
837 std::map<int, std::pair<SUMOTime, SUMOTime>> angleTimesMap;
838 int tripletCount = 0;
842 if (pos.
size() != 3) {
844 throw ProcessError(
"manoeuverAngleTimes format for vType '" + vtype.
id +
"' " + atm +
" contains an invalid triplet.");
846 WRITE_ERROR(
"manoeuverAngleTimes format for vType '" + vtype.
id +
"' " + atm +
" contains an invalid triplet.");
856 angleTimesMap.insert((std::pair<
int, std::pair<SUMOTime, SUMOTime>>(angle, std::pair< SUMOTime, SUMOTime>(t1, t2))));
858 WRITE_ERROR(
"Triplet '" + st.
get(tripletCount) +
"' for vType '" + vtype.
id +
"' manoeuverAngleTimes cannot be parsed as 'int double double'");
864 if (angleTimesMap.size() > 0) {
866 for (std::pair<
int, std::pair<SUMOTime, SUMOTime>> angleTime : angleTimesMap) {
869 angleTimesMap.clear();
880 bool abortCreation =
true;
881 CFAttrMap::const_iterator cf_it = allowedCFM.find(element);
883 if (cf_it == allowedCFM.end()) {
885 handleError(hardFail, abortCreation,
"Unknown car following model " +
toString(element) +
" when parsing vType '" + into.
id +
"'");
887 handleError(hardFail, abortCreation,
"Unknown car following model when parsing vType '" + into.
id +
"'");
898 for (
const auto& it : cf_it->second) {
901 std::string parsedCFMAttribute = attrs.
get<std::string>(it, into.
id.c_str(), ok);
908 }
else if (hardFail) {
909 throw ProcessError(
"Invalid train type '" + parsedCFMAttribute +
"' used in Car-Following-Attribute " +
toString(it));
911 WRITE_ERROR(
"Invalid train type '" + parsedCFMAttribute +
"' used in Car-Following-Attribute " +
toString(it));
915 int CFMIntAttribute = -1;
922 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Cannot be parsed to int");
924 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Cannot be parsed to int");
929 if (CFMIntAttribute <= 0) {
932 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Must be greater than 0");
934 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Must be greater than 0");
944 double CFMDoubleAttribute = -1;
951 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
953 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
969 if (CFMDoubleAttribute <= 0) {
972 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Must be greater than 0");
974 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Must be greater than 0");
983 if ((CFMDoubleAttribute < 0) || (CFMDoubleAttribute > 1)) {
986 throw ProcessError(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Only values between [0-1] are allowed");
988 WRITE_ERROR(
"Invalid Car-Following-Model Attribute " +
toString(it) +
". Only values between [0-1] are allowed");
998 WRITE_WARNING(
"Value of tau=" + parsedCFMAttribute +
" in car following model '" +
999 toString(into.
cfModel) +
"' lower than simulation step size may cause collisions");
1018 std::set<SumoXMLAttr> kraussParams;
1028 std::set<SumoXMLAttr> allParams(kraussParams);
1030 std::set<SumoXMLAttr> kraussXParams(kraussParams);
1037 allParams.insert(kraussXParams.begin(), kraussXParams.end());
1039 std::set<SumoXMLAttr> smartSKParams;
1052 allParams.insert(smartSKParams.begin(), smartSKParams.end());
1054 std::set<SumoXMLAttr> daniel1Params;
1067 allParams.insert(daniel1Params.begin(), daniel1Params.end());
1069 std::set<SumoXMLAttr> pwagParams;
1079 allParams.insert(pwagParams.begin(), pwagParams.end());
1081 std::set<SumoXMLAttr> idmParams;
1090 allParams.insert(idmParams.begin(), idmParams.end());
1092 std::set<SumoXMLAttr> idmmParams;
1102 allParams.insert(idmmParams.begin(), idmmParams.end());
1104 std::set<SumoXMLAttr> bkernerParams;
1113 allParams.insert(bkernerParams.begin(), bkernerParams.end());
1115 std::set<SumoXMLAttr> wiedemannParams;
1123 allParams.insert(wiedemannParams.begin(), wiedemannParams.end());
1125 std::set<SumoXMLAttr> w99Params;
1138 allParams.insert(w99Params.begin(), w99Params.end());
1140 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;
1235 std::set<SumoXMLAttr> sl2015Params = lc2013Params;
1246 std::set<SumoXMLAttr> noParams;
1255 for (
const auto& it : allowed) {
1258 std::string parsedLCMAttribute = attrs.
get<std::string>(it, into.
id.c_str(), ok);
1260 double LCMAttribute = -1;
1267 throw ProcessError(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
1269 WRITE_ERROR(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
1287 if (LCMAttribute < 0) {
1290 throw ProcessError(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Must be equal or greater than 0");
1292 WRITE_ERROR(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Must be equal or greater than 0");
1302 if (LCMAttribute <= 0) {
1305 throw ProcessError(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Must be greater than 0");
1307 WRITE_ERROR(
"Invalid Lane-Change-Model Attribute " +
toString(it) +
". Must be greater than 0");
1342 std::string parsedJMAttribute = attrs.
get<std::string>(it, into.
id.c_str(), ok);
1344 double JMAttribute = -1;
1351 throw ProcessError(
"Invalid Junction-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
1353 WRITE_ERROR(
"Invalid Junction-Model Attribute " +
toString(it) +
". Cannot be parsed to float");
1357 if (ok && (JMAttribute != -1)) {
1361 if ((JMAttribute < 0) || (JMAttribute > 1)) {
1364 throw ProcessError(
"Invalid Junction-Model Attribute " +
toString(it) +
". Only values between [0-1] are allowed");
1366 WRITE_ERROR(
"Invalid Junction-Model Attribute " +
toString(it) +
". Only values between [0-1] are allowed");
1371 if (JMAttribute < 0) {
1374 throw ProcessError(
"Invalid Junction-Model Attribute " +
toString(it) +
". Must be equal or greater than 0");
1376 WRITE_ERROR(
"Invalid Junction-Model Attribute " +
toString(it) +
". Must be equal or greater than 0");
1396 if (vclassS ==
"") {
1402 if (realName != vclassS) {
1403 WRITE_WARNING(
"The vehicle class '" + vclassS +
"' for " + attrs.
getObjectType() +
" '" +
id +
"' is deprecated, use '" + realName +
"' instead.");
1420 if (realName != vclassS) {
1421 WRITE_WARNING(
"The shape '" + vclassS +
"' for " + attrs.
getObjectType() +
" '" +
id +
"' is deprecated, use '" + realName +
"' instead.");
1447 result = maxPos / 2.;
1460 std::stringstream ss;
1461 ss <<
"The parameter action-step-length must be a non-negative multiple of the simulation step-length. Ignoring given value (="
1466 }
else if (result %
DELTA_T != 0) {
1467 std::stringstream ss;
1471 ss <<
"The parameter action-step-length must be a non-negative multiple of the simulation step-length. Parsing given value ("
1472 << given <<
" s.) to the adjusted value "
1484 abortCreation =
true;
const int VTYPEPARS_LATALIGNMENT_SET
static SUMOVehicleParameter * handleError(const bool hardFail, bool &abortCreation, const std::string &message)
handle error loading SUMOVehicleParameter
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons)
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_LCA_SPEEDGAIN_PARAM
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
SubParams lcParameter
Lane-changing parameter.
int containerNumber
The static number of containers in the vehicle when it departs.
@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
@ SUMO_ATTR_GC_GAIN_GAP_CACC
ArrivalPosDefinition
Possible ways to choose the arrival position.
@ SUMO_ATTR_CF_CC_CCDECEL
double length
The physical vehicle length.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color)
@ SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
const int VTYPEPARS_MINGAP_SET
static CFAttrMap allowedCFModelAttrs
allowed attrs for each known CF-model
#define WRITE_WARNING(msg)
@ SUMO_ATTR_CF_IDMM_ADAPT_FACTOR
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
const std::string DEFAULT_PEDTYPE_ID
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.
RGBColor color
The vehicle's color, TraCI may change this.
@ SUMO_ATTR_LCA_COOPERATIVE_PARAM
@ SUMO_ATTR_CF_IDM_STEPPING
@ ARRIVAL_POS_RANDOM
The arrival position is chosen randomly.
@ SUMO_TAG_CF_KRAUSS_ORIG1
SUMOTime actionStepLength
The vehicle type's default actionStepLength [ms], i.e. the interval between two control actions....
bool hasNext()
returns the information whether further substrings exist
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
double departSpeed
(optional) The initial speed of the vehicle
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
const int VTYPEPARS_BOARDING_DURATION
std::string vtypeid
The vehicle's type id.
const int VEHPARS_NUMBER_SET
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
const int VEHPARS_FORCE_REROUTE
std::map< LaneChangeModel, std::set< SumoXMLAttr > > LCAttrMap
Lane-Change-Model attributes map.
double impatience
The vehicle's impatience (willingness to obstruct others)
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
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 const RGBColor YELLOW
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
@ SUMO_ATTR_ARRIVALPOS_LAT
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
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 osgFile
3D model file for this class
ArrivalPosLatDefinition
Possible ways to choose the departure position.
@ SUMO_ATTR_CF_PWAGNER2009_APPROB
const int VTYPEPARS_MINGAP_LAT_SET
static std::set< SumoXMLAttr > allowedJMAttrs
allowed attrs for the junction model
const int VEHPARS_ARRIVALSPEED_SET
bool isValid(std::string &error)
check whether the distribution is valid
const std::string & getObjectType() const
return the objecttype to which these attributes belong
@ SUMO_ATTR_PERSONSPERHOUR
@ SUMO_ATTR_LOADING_DURATION
@ SUMO_ATTR_LCA_LANE_DISCIPLINE
@ SUMO_ATTR_COLOR
A color information.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
const int VTYPEPARS_OSGFILE_SET
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.
@ SUMO_ATTR_GC_GAIN_GAP_DOT_CACC
@ SUMO_ATTR_CONTAINER_CAPACITY
std::map< int, std::pair< SUMOTime, SUMOTime > > myManoeuverAngleTimes
Map of manoeuver angles versus the times (entry, exit) to execute the manoeuver.
Structure representing possible vehicle parameter.
@ SUMO_TAG_NOTHING
invalid tag
SUMOVehicleShape shape
This class' shape.
const int VTYPEPARS_PROBABILITY_SET
@ SUMO_ATTR_CF_CC_FLATBED_KA
@ SUMO_TAG_VTYPE
description of a vehicle type
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
@ SUMO_ATTR_LCA_MAXSPEEDLATFACTOR
@ SUMO_ATTR_LCA_KEEPRIGHT_PARAM
@ SUMO_ATTR_LANE_CHANGE_MODEL
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 containerCapacity
The container capacity of the vehicle.
SumoXMLTag
Numbers representing SUMO-XML - element names.
const int VEHPARS_PROB_SET
@ SUMO_ATTR_CF_CC_FLATBED_KP
@ SUMO_ATTR_JM_IGNORE_FOE_PROB
const int VEHPARS_DEPARTSPEED_SET
@ SUMO_ATTR_LCA_EXPERIMENTAL1
@ SUMO_ATTR_JM_TIMEGAP_MINOR
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
const int VTYPEPARS_CAR_FOLLOW_MODEL
@ SUMO_ATTR_JM_IGNORE_FOE_SPEED
SumoXMLTag tag
The vehicle tag.
static SUMOVehicleParameter * parseVehicleAttributes(const SUMOSAXAttributes &attrs, const bool hardFail, const bool optionalID=false, const bool skipDepart=false, const bool isPerson=false)
Parses a vehicle's attributes.
@ SUMO_ATTR_BEGIN
weights: time range begin
static StringBijection< SumoXMLTag > CarFollowModels
car following models
@ SUMO_ATTR_LCA_MAXSPEEDLATSTANDING
const int VEHPARS_ARRIVALLANE_SET
const int VEHPARS_ROUTE_SET
int parametersSet
Information for the router which parameter were set.
@ SUMO_ATTR_PERSON_NUMBER
const int VTYPEPARS_MAXSPEED_LAT_SET
std::string line
The vehicle's line (mainly for public transport)
std::string get(int pos) const
returns the item at the given position
@ SUMO_ATTR_LCA_SUBLANE_PARAM
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
@ SUMO_TAG_ROUTEFLOW
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT)
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
@ SUMO_ATTR_CF_CC_CONSTSPACING
@ SUMO_ATTR_APPARENTDECEL
std::vector< double > & getParameter()
Returns the parameters of this distribution.
static LCAttrMap allowedLCModelAttrs
allowed attrs for each known LC-model
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
const int VEHPARS_ARRIVALPOS_SET
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
std::string imgFile
Image file for this class.
static SUMOVTypeParameter * beginVTypeParsing(const SUMOSAXAttributes &attrs, const bool hardFail, const std::string &file)
Starts to parse a vehicle type.
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
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.
@ SUMO_ATTR_GCC_GAIN_GAP_CACC
double height
This class' height.
@ SUMO_ATTR_LCA_OPPOSITE_PARAM
@ SUMO_ATTR_CF_CC_FLATBED_H
Structure representing possible vehicle parameter.
const int VEHPARS_COLOR_SET
SubParams jmParameter
Junction-model parameter.
T get(const std::string &str) const
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
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.
SubParams cfParameter
Car-following parameter.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
@ SUMO_ATTR_DEPARTPOS_LAT
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SUMO_ATTR_LCA_SPEEDGAINRIGHT
std::string id
The vehicle's id.
static void parseCommonAttributes(const SUMOSAXAttributes &attrs, const bool hardFail, SUMOVehicleParameter *ret, std::string element)
Parses attributes common to vehicles and flows.
@ SUMO_ATTR_JM_DRIVE_RED_SPEED
double repetitionProbability
The probability for emitting a vehicle per second.
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
@ SUMO_ATTR_CF_CC_PLOEG_KP
double arrivalPos
(optional) The position the vehicle shall arrive on
const int VEHPARS_LINE_SET
std::string fromTaz
The vehicle's origin zone (district)
@ SUMO_ATTR_CA_GAIN_SPEED
@ SUMO_ATTR_CA_GAIN_GAP_CACC
@ SUMO_ATTR_PERSON_CAPACITY
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
@ SUMO_TAG_CF_KRAUSS_PLUS_SLOPE
@ SUMO_ATTR_LCA_LOOKAHEADLEFT
@ SUMO_ATTR_CONTAINER_NUMBER
SUMOTime boardingDuration
The time a person needs to board the vehicle.
double minGap
This class' free space in front of the vehicle itself.
@ SUMO_ATTR_LCA_OVERTAKE_RIGHT
double arrivalPosLat
(optional) The lateral position the vehicle shall arrive on
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.
@ SUMO_ATTR_LCA_STRATEGIC_PARAM
double width
This class' width.
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.
static SUMOVehicleClass parseVehicleClass(const SUMOSAXAttributes &attrs, const std::string &id)
Parses the vehicle class.
@ SUMO_ATTR_JM_SIGMA_MINOR
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
const int VEHPARS_ARRIVALPOSLAT_SET
double maxSpeed
The vehicle type's maximum speed [m/s].
int personCapacity
The person capacity of the vehicle.
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.
std::string routeid
The vehicle's route id.
@ SUMO_TAG_CF_PWAGNER2009
const int VTYPEPARS_SPEEDFACTOR_SET
@ SUMO_ATTR_LCA_IMPATIENCE
@ SUMO_TAG_VEHICLE
description of a vehicle
SUMOTime string2time(const std::string &r)
int size() const
returns the number of existing substrings
const int VEHPARS_VPH_SET
double departPosLat
(optional) The lateral position the vehicle shall depart from
static bool parseAngleTimesMap(SUMOVTypeParameter &vtype, const std::string, const bool hardFail)
Parse string containing AngleTimes triplets (angle, entry time, exit time)
std::map< SumoXMLTag, std::set< SumoXMLAttr > > CFAttrMap
Car-Following attributes map.
@ SUMO_ATTR_LCA_ASSERTIVE
const int VEHPARS_DEPARTLANE_SET
@ SUMO_ATTR_CF_CC_LANES_COUNT
@ SUMO_ATTR_CF_WIEDEMANN_SECURITY
@ SUMO_ATTR_CF_CC_FLATBED_D
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
@ SUMO_ATTR_GCC_GAIN_GAP_DOT_CACC
DepartLaneDefinition
Possible ways to choose a lane on depart.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
@ SUMO_ATTR_JM_CROSSING_GAP
const int VTYPEPARS_LOADING_DURATION
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
static const CFAttrMap & getAllowedCFModelAttrs()
returns allowed attrs for each known CF-model (init on first use)
@ SUMO_ATTR_CA_GAIN_GAP_DOT_CACC
const int VTYPEPARS_CONTAINER_CAPACITY
const int VEHPARS_SPEEDFACTOR_SET
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const int VEHPARS_VTYPE_SET
@ SUMO_ATTR_CF_PWAGNER2009_TAULAST
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
virtual std::string getName(int attr) const =0
Converts the given attribute id into a man readable string.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static SUMOVehicleParameter * parseFlowAttributes(const SUMOSAXAttributes &attrs, const bool hardFail, const SUMOTime beginDefault, const SUMOTime endDefault, bool isPerson=false)
Parses a flow's attributes.
const int VEHPARS_DEPARTPOSLAT_SET
@ SUMO_ATTR_CF_CC_FLATBED_KV
@ SUMO_ATTR_CF_CC_PLOEG_H
static StringBijection< int > Tags
The names of SUMO-XML elements for use in netbuild.
LateralAlignment latAlignment
The vehicles desired lateral alignment.
@ SUMO_ATTR_CAR_FOLLOW_MODEL
std::string id
The vehicle type's id.
const int VEHPARS_CONTAINER_NUMBER_SET
static StringBijection< TrainType > TrainTypes
train types
const int VEHPARS_DEPARTPOS_SET
@ SUMO_ATTR_LCA_TIME_TO_IMPATIENCE
static bool parseLCParams(SUMOVTypeParameter &into, LaneChangeModel model, const SUMOSAXAttributes &attrs, const bool hardFail)
Parses lane change model attributes.
const int VEHPARS_PERSON_NUMBER_SET
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
static bool parseJMParams(SUMOVTypeParameter &into, const SUMOSAXAttributes &attrs, const bool hardFail)
Parses junction model attributes.
const int VEHPARS_FROM_TAZ_SET
const int VTYPEPARS_PERSON_CAPACITY
DepartPosDefinition
Possible ways to choose the departure position.
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
const int VTYPEPARS_HEIGHT_SET
@ SUMO_ATTR_EMERGENCYDECEL
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
@ SUMO_ATTR_CF_CC_PLOEG_KD
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 bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
@ SUMO_ATTR_GC_GAIN_SPEED
const int VEHPARS_TO_TAZ_SET
LaneChangeModel lcModel
The lane-change model to use.
const int VTYPEPARS_IMGFILE_SET
@ ARRIVAL_POS_MAX
The maximum arrival position is used.
@ SUMO_ATTR_GCC_GAIN_SPACE
@ SUMO_ATTR_ACTIONSTEPLENGTH
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_HEADWAY_TIME_CACC_TO_ACC
@ SUMO_ATTR_GC_GAIN_SPACE
DepartSpeedDefinition
Possible ways to choose the departure speed.
@ SUMO_ATTR_MANEUVER_ANGLE_TIMES
Class specific timing values for vehicle manoeuvering through angle ranges.
const int VEHPARS_PERIOD_SET
const int VTYPEPARS_LENGTH_SET
std::string toTaz
The vehicle's destination zone (district)
@ ARRIVAL_POS_CENTER
Half the road length.
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
const int VTYPEPARS_MANEUVER_ANGLE_TIMES_SET
double speedFactor
individual speedFactor (overriding distribution from vType)
void parse(const std::string &description, const bool hardFail)
Overwrite by parsable distribution description.
static std::string parseID(const SUMOSAXAttributes &attrs, const SumoXMLTag element)
parse ID
SUMOEmissionClass emissionClass
The emission class of this vehicle.
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.
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_SHAPE_SET
const int VEHPARS_END_SET
static SUMOVehicleShape parseGuiShape(const SUMOSAXAttributes &attrs, const std::string &id)
Parses the vehicle class.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SVC_IGNORING
vehicles ignoring classes
@ SUMO_ATTR_GCC_GAIN_SPEED
const int VTYPEPARS_WIDTH_SET
Encapsulated SAX-Attributes.
const int VTYPEPARS_IMPATIENCE_SET
@ SUMO_ATTR_CA_GAIN_SPACE
@ SUMO_ATTR_EMISSIONCLASS
const int VTYPEPARS_MAXSPEED_SET
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
@ SUMO_TAG_TRIP
a single trip definition (used by router)
const int VTYPEPARS_VEHICLECLASS_SET
@ SUMO_ATTR_CF_KERNER_PHI
@ SUMO_ATTR_CF_CC_CCACCEL
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
@ SUMO_ATTR_CF_IDMM_ADAPT_TIME
@ SUMO_ATTR_LCA_ACCEL_LAT
double minGapLat
The vehicle type's minimum lateral gap [m].
@ SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.