50 repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
51 line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0), parametersSet(0) {
61 return oc.
exists(optionName) && oc.
isSet(optionName) && oc.
getBool(
"defaults-override");
85 }
else if (oc.
exists(
"departlane") && oc.
isSet(
"departlane")) {
91 }
else if (oc.
exists(
"departpos") && oc.
isSet(
"departpos")) {
102 }
else if (oc.
exists(
"departspeed") && oc.
isSet(
"departspeed")) {
108 }
else if (oc.
exists(
"arrivallane") && oc.
isSet(
"arrivallane")) {
114 }
else if (oc.
exists(
"arrivalpos") && oc.
isSet(
"arrivalpos")) {
124 }
else if (oc.
exists(
"arrivalspeed") && oc.
isSet(
"arrivalspeed")) {
161 containerTriggered(false),
221 if (val ==
"triggered") {
223 }
else if (val ==
"containerTriggered") {
225 }
else if (val ==
"now") {
233 error =
"Negative departure time in the definition of '" +
id +
"'.";
238 error =
"Invalid departure time for " + element +
". Must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
240 error =
"Invalid departure time for " + element +
" '" +
id +
"';\n must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
253 if (val ==
"random") {
255 }
else if (val ==
"free") {
257 }
else if (val ==
"allowed") {
259 }
else if (val ==
"best") {
261 }
else if (val ==
"first") {
277 error =
"Invalid departLane definition for " + element +
". Must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
279 error =
"Invalid departLane definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
290 if (val ==
"random") {
292 }
else if (val ==
"random_free") {
294 }
else if (val ==
"free") {
296 }
else if (val ==
"base") {
298 }
else if (val ==
"last") {
311 error =
"Invalid departPos definition for " + element +
". Must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
313 error =
"Invalid departPos definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
324 if (val ==
"random") {
326 }
else if (val ==
"random_free") {
328 }
else if (val ==
"free") {
330 }
else if (val ==
"right") {
332 }
else if (val ==
"center") {
334 }
else if (val ==
"left") {
347 error =
"Invalid departPosLat definition for " + element +
". Must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
349 error =
"Invalid departPosLat definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
360 if (val ==
"random") {
362 }
else if (val ==
"max") {
364 }
else if (val ==
"desired") {
366 }
else if (val ==
"speedLimit") {
382 error =
"Invalid departSpeed definition for " + element +
". Must be one of (\"random\", \"max\", or a float>=0)";
384 error =
"Invalid departSpeed definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"max\", or a float>=0)";
395 if (val ==
"current") {
411 error =
"Invalid arrivalLane definition for " + element +
". Must be one of (\"current\", or an int>=0)";
413 error =
"Invalid arrivalLane definition for " + element +
" '" +
id +
"';\n must be one of (\"current\", or an int>=0)";
424 if (val ==
"random") {
426 }
else if (val ==
"center") {
428 }
else if (val ==
"max") {
441 error =
"Invalid arrivalPos definition for " + element +
". Must be one of (\"random\", \"max\", or a float)";
443 error =
"Invalid arrivalPos definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"max\", or a float)";
454 if (val ==
"right") {
456 }
else if (val ==
"center") {
458 }
else if (val ==
"left") {
471 error =
"Invalid arrivalPosLat definition for " + element +
". Must be one of (\"right\", \"center\", \"left\", or a float)";
473 error =
"Invalid arrivalPosLat definition for " + element +
" '" +
id +
"';\n must be one of (\"right\", \"center\", \"left\", or a float)";
484 if (val ==
"current") {
500 error =
"Invalid arrivalSpeed definition for " + element +
". Must be one of (\"current\", or a float>=0)";
502 error =
"Invalid arrivalSpeed definition for " + element +
" '" +
id +
"';\n must be one of (\"current\", or a float>=0)";
512 pos = maximumValue + pos;
514 if (pos > maximumValue) {
526 const std::string mode = st.next();
529 }
else if (mode ==
"bicycle") {
531 }
else if (mode ==
"public") {
535 error =
"Unknown person mode '" + mode +
"'. Must be a combination of (\"car\", \"bicycle\" or \"public\")";
537 error =
"Unknown person mode '" + mode +
"' for " + element +
" '" +
id +
"';\n must be a combination of (\"car\", \"bicycle\" or \"public\")";
551 return "containerTriggered";
The departure is person triggered.
const int VEHPARS_TO_TAZ_SET
The current lane shall be used.
const int STOP_CONTAINER_TRIGGER_SET
virtual ~SUMOVehicleParameter()
Destructor.
No information given; use default.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
SumoXMLTag
Numbers representing SUMO-XML - element names.
RGBColor color
The vehicle's color, TraCI may change this.
A free lateral position is chosen.
std::string lane
The lane to stop at.
At the leftmost side of the lane.
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
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.
The vehicle is discarded if emission fails (not fully implemented yet)
bool defaultOptionOverrides(const OptionsCont &oc, const std::string &optionName) const
Returns whether the defaults shall be used.
std::string vtypeid
The vehicle's type id.
a flow definitio nusing a from-to edges instead of a route (used by router)
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
The departure is container triggered.
At the leftmost side of the lane.
std::string getArrivalSpeed() const
obtain arrival speed parameter in string format
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
std::string line
the new line id of the trip within a cyclical public transport route
The lateral position is chosen randomly.
The least occupied lane is used.
If a fixed number of random choices fails, a free lateral position is chosen.
std::string time2string(SUMOTime t)
std::string getArrivalPosLat() const
obtain arrival pos lat parameter in string format
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
weights: time range begin
std::string busstop
(Optional) bus stop if one is assigned to the stop
int parametersSet
Information for the output which parameter were set.
std::string getDepartPosLat() const
obtain depart pos lat parameter in string format
const int VEHPARS_ARRIVALLANE_SET
The speed is chosen randomly.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
The lane is chosen randomly.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
The arrival position is given.
bool hasNext()
returns the information whether further substrings exist
ArrivalPosLatDefinition
Possible ways to choose the departure position.
std::string parkingarea
(Optional) parking area if one is assigned to the stop
const std::string DEFAULT_VTYPE_ID
The least occupied lane from best lanes.
The position is chosen randomly.
#define WRITE_WARNING(msg)
bool triggered
whether an arriving person lets the vehicle continue
std::string toTaz
The vehicle's destination zone (district)
std::string tripId
id of the trip within a cyclical public transport route
const int VEHPARS_ARRIVALSPEED_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 departSpeed
(optional) The initial speed of the vehicle
SUMOVehicleParameter()
Constructor.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
No information given; use default.
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
DepartLaneDefinition
Possible ways to choose a lane on depart.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
OutputDevice & writeNonEmptyAttr(const SumoXMLAttr attr, const std::string &val)
writes a string attribute only if it is not the empty string and not the string "default" ...
At the center of the lane.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
The least occupied lane from lanes which allow the continuation.
const int VEHPARS_DEPARTSPEED_SET
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
std::string getDepartPos() const
obtain depart pos parameter in string format
The current speed is used.
SUMOTime until
The time at which the vehicle may continue its journey.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
std::string getArrivalPos() const
obtain arrival pos parameter in string format
At the rightmost side of the lane.
const int VEHPARS_DEPARTPOSLAT_SET
bool exists(const std::string &name) const
Returns the information whether the named option is known.
The maximum safe speed is used.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOTime string2time(const std::string &r)
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
Writes the parameters as a beginning element.
const int STOP_TRIP_ID_SET
The maximum lane speed is used (speedLimit * speedFactor)
std::string fromTaz
The vehicle's origin zone (district)
No information given; use default.
const int STOP_EXPECTED_SET
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.
void write(OutputDevice &dev) const
Writes the stop as XML.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
double endPos
The stopping position end.
An upper class for objects with additional parameters.
const int VEHPARS_COLOR_SET
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons) ...
If a fixed number of random choices fails, a free position is chosen.
vehicle is a passenger car (a "normal" car)
std::string getArrivalLane() const
obtain arrival lane parameter in string format
const int VEHPARS_FROM_TAZ_SET
The rightmost lane the vehicle may use.
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
std::string line
The vehicle's line (mainly for public transport)
The maximum lane speed is used (speedLimit)
double arrivalPos
(optional) The position the vehicle shall arrive on
DepartSpeedDefinition
Possible ways to choose the departure speed.
const int VEHPARS_ARRIVALPOSLAT_SET
const int VEHPARS_LINE_SET
const int VEHPARS_ARRIVALPOS_SET
No information given; use default.
const int STOP_PARKING_SET
double departPos
(optional) The position the vehicle shall depart from
double startPos
The stopping position start.
const int STOP_TRIGGER_SET
std::string getDepartLane() const
obtain depart lane parameter in string format
static bool parsePersonModes(const std::string &modes, const std::string &element, const std::string &id, SVCPermissions &modeSet, std::string &error)
Validates a given person modes value.
const int STOP_EXPECTED_CONTAINERS_SET
bool containerTriggered
whether an arriving container lets the vehicle continue
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.
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.
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.
At the rightmost side of the lane.
At the center of the lane.
SumoXMLTag tag
The vehicle tag.
A storage for options typed value containers)
const int VEHPARS_DEPARTLANE_SET
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.
No information given; use default.
The arrival lane is given.
int containerNumber
The static number of containers in the vehicle when it departs.
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.
No information given; use default.
std::string getDepartSpeed() const
obtain depart speed parameter in string format
bool wasSet(int what) const
Returns whether the given parameter was set.
const int VEHPARS_VTYPE_SET
No information given; use default.
Static storage of an output device and its base (abstract) implementation.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
ArrivalPosDefinition
Possible ways to choose the arrival position.
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
std::string getDepart() const
obtain depart parameter in string format
std::string containerstop
(Optional) container stop if one is assigned to the stop
No information given; use default.
A free position is chosen.
const int VEHPARS_DEPARTPOS_SET
Insert behind the last vehicle as close as possible to still allow the specified departSpeed. Fallback to DEPART_POS_BASE if there is no vehicle on the departLane yet.
const int VEHPARS_PERSON_NUMBER_SET
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
DepartPosDefinition
Possible ways to choose the departure position.
const int VEHPARS_CONTAINER_NUMBER_SET
The maximum arrival position is used.
SUMOTime duration
The stopping duration.
DepartDefinition
Possible ways to depart.
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.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
bool parking
whether the vehicle is removed from the net while stopping
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
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.
The arrival position is chosen randomly.
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.