 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
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),
172 if (containerstop !=
"") {
175 if (parkingarea !=
"") {
178 if (busstop ==
"" && containerstop ==
"" && parkingarea ==
"") {
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";
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons)
int containerNumber
The static number of containers in the vehicle when it departs.
The arrival position is given.
bool wasSet(int what) const
Returns whether the given parameter was set.
ArrivalPosDefinition
Possible ways to choose the arrival position.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color)
#define WRITE_WARNING(msg)
An upper class for objects with additional parameters.
If a fixed number of random choices fails, a free lateral position is chosen.
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
No information given; use default.
RGBColor color
The vehicle's color, TraCI may change this.
The arrival lane is given.
std::string getArrivalPos() const
obtain arrival pos parameter in string format
Static storage of an output device and its base (abstract) implementation.
The arrival position is chosen randomly.
std::string getDepartSpeed() const
obtain depart speed parameter in string format
bool hasNext()
returns the information whether further substrings exist
double departSpeed
(optional) The initial speed of the vehicle
No information given; use default.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
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.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
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.
At the leftmost side of the lane.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
No information given; use default.
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 current speed is used.
ArrivalPosLatDefinition
Possible ways to choose the departure position.
The least occupied lane from best lanes.
Insert behind the last vehicle as close as possible to still allow the specified departSpeed....
bool exists(const std::string &name) const
Returns the information whether the named option is known.
DepartDefinition
Possible ways to depart.
const int VEHPARS_ARRIVALSPEED_SET
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
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.
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_TRIP_ID_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.
SUMOVehicleParameter()
Constructor.
SumoXMLTag
Numbers representing SUMO-XML - element names.
At the rightmost side of the lane.
const int VEHPARS_DEPARTSPEED_SET
The maximum lane speed is used (speedLimit)
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
SumoXMLTag tag
The vehicle tag.
std::string getDepartPosLat() const
obtain depart pos lat parameter in string format
weights: time range begin
The least occupied lane from lanes which allow the continuation.
No information given; use default.
const int VEHPARS_ARRIVALLANE_SET
std::string line
The vehicle's line (mainly for public transport)
A free lateral position is chosen.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
The lane is chosen randomly.
At the rightmost side of the lane.
a flow definitio nusing a from-to edges instead of a route (used by router)
const int VEHPARS_ARRIVALPOS_SET
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.
A free position is chosen.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
std::string getArrivalPosLat() const
obtain arrival pos lat parameter in string format
The maximum lane speed is used (speedLimit * speedFactor)
std::string getDepart() const
obtain depart parameter in string format
At the leftmost side of the lane.
const int VEHPARS_COLOR_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.
const std::string DEFAULT_VTYPE_ID
No information given; use default.
vehicle is a passenger car (a "normal" car)
virtual ~SUMOVehicleParameter()
Destructor.
double arrivalPos
(optional) The position the vehicle shall arrive on
const int VEHPARS_LINE_SET
std::string fromTaz
The vehicle's origin zone (district)
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
std::string time2string(SUMOTime t)
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.
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.
void write(OutputDevice &dev) const
Writes the stop as XML.
A storage for options typed value containers)
The departure is person triggered.
const int VEHPARS_ARRIVALPOSLAT_SET
The current lane shall be used.
The speed is chosen randomly.
The position is chosen randomly.
std::string getDepartPos() const
obtain depart pos parameter in string format
std::string getDepartLane() const
obtain depart lane parameter in string format
SUMOTime string2time(const std::string &r)
const int VEHPARS_DEPARTLANE_SET
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"
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.
DepartLaneDefinition
Possible ways to choose a lane on depart.
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const int VEHPARS_VTYPE_SET
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
const int VEHPARS_DEPARTPOSLAT_SET
const int VEHPARS_CONTAINER_NUMBER_SET
const int VEHPARS_DEPARTPOS_SET
No information given; use default.
const int VEHPARS_PERSON_NUMBER_SET
const int VEHPARS_FROM_TAZ_SET
The lateral position is chosen randomly.
If a fixed number of random choices fails, a free position is chosen.
DepartPosDefinition
Possible ways to choose the departure position.
At the center of the lane.
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
const int STOP_EXPECTED_SET
The maximum safe speed is used.
No information given; use default.
const int VEHPARS_TO_TAZ_SET
const int STOP_TRIGGER_SET
const int STOP_CONTAINER_TRIGGER_SET
The maximum arrival position is used.
No information given; use default.
const int STOP_EXPECTED_CONTAINERS_SET
const int STOP_PARKING_SET
DepartSpeedDefinition
Possible ways to choose the departure speed.
std::string toTaz
The vehicle's destination zone (district)
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.
At the center of the lane.
The departure is container triggered.
std::string getArrivalLane() const
obtain arrival lane parameter in string format
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string getArrivalSpeed() const
obtain arrival speed parameter in string format
The least occupied lane is used.
The rightmost lane the vehicle may use.
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.
The vehicle is discarded if emission fails (not fully implemented yet)
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.