 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
49 repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
50 line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0),
62 return oc.
exists(optionName) && oc.
isSet(optionName) && oc.
getBool(
"defaults-override");
86 }
else if (oc.
exists(
"departlane") && oc.
isSet(
"departlane")) {
92 }
else if (oc.
exists(
"departpos") && oc.
isSet(
"departpos")) {
103 }
else if (oc.
exists(
"departspeed") && oc.
isSet(
"departspeed")) {
109 }
else if (oc.
exists(
"arrivallane") && oc.
isSet(
"arrivallane")) {
115 }
else if (oc.
exists(
"arrivalpos") && oc.
isSet(
"arrivalpos")) {
125 }
else if (oc.
exists(
"arrivalspeed") && oc.
isSet(
"arrivalspeed")) {
167 containerTriggered(false),
180 if (containerstop !=
"") {
183 if (chargingStation !=
"") {
186 if (parkingarea !=
"") {
189 if ((busstop ==
"") && (containerstop ==
"") && (parkingarea ==
"") && (chargingStation ==
"")) {
232 if (friendlyPos ==
true) {
236 if (!actType.empty()) {
246 if (val ==
"triggered") {
248 }
else if (val ==
"containerTriggered") {
250 }
else if (val ==
"now") {
258 error =
"Negative departure time in the definition of '" +
id +
"'.";
263 error =
"Invalid departure time for " + element +
". Must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
265 error =
"Invalid departure time for " + element +
" '" +
id +
"';\n must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
278 if (val ==
"random") {
280 }
else if (val ==
"free") {
282 }
else if (val ==
"allowed") {
284 }
else if (val ==
"best") {
286 }
else if (val ==
"first") {
302 error =
"Invalid departLane definition for " + element +
". Must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
304 error =
"Invalid departLane definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
315 if (val ==
"random") {
317 }
else if (val ==
"random_free") {
319 }
else if (val ==
"free") {
321 }
else if (val ==
"base") {
323 }
else if (val ==
"last") {
325 }
else if (val ==
"stop") {
338 error =
"Invalid departPos definition for " + element +
". Must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
340 error =
"Invalid departPos definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
351 if (val ==
"random") {
353 }
else if (val ==
"random_free") {
355 }
else if (val ==
"free") {
357 }
else if (val ==
"right") {
359 }
else if (val ==
"center") {
361 }
else if (val ==
"left") {
374 error =
"Invalid departPosLat definition for " + element +
". Must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
376 error =
"Invalid departPosLat definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
387 if (val ==
"random") {
389 }
else if (val ==
"max") {
391 }
else if (val ==
"desired") {
393 }
else if (val ==
"speedLimit") {
409 error =
"Invalid departSpeed definition for " + element +
". Must be one of (\"random\", \"max\", or a float>=0)";
411 error =
"Invalid departSpeed definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"max\", or a float>=0)";
422 if (val ==
"current") {
438 error =
"Invalid arrivalLane definition for " + element +
". Must be one of (\"current\", or an int>=0)";
440 error =
"Invalid arrivalLane definition for " + element +
" '" +
id +
"';\n must be one of (\"current\", or an int>=0)";
451 if (val ==
"random") {
453 }
else if (val ==
"center") {
455 }
else if (val ==
"max") {
468 error =
"Invalid arrivalPos definition for " + element +
". Must be one of (\"random\", \"max\", or a float)";
470 error =
"Invalid arrivalPos definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"max\", or a float)";
481 if (val ==
"right") {
483 }
else if (val ==
"center") {
485 }
else if (val ==
"left") {
498 error =
"Invalid arrivalPosLat definition for " + element +
". Must be one of (\"right\", \"center\", \"left\", or a float)";
500 error =
"Invalid arrivalPosLat definition for " + element +
" '" +
id +
"';\n must be one of (\"right\", \"center\", \"left\", or a float)";
511 if (val ==
"current") {
527 error =
"Invalid arrivalSpeed definition for " + element +
". Must be one of (\"current\", or a float>=0)";
529 error =
"Invalid arrivalSpeed definition for " + element +
" '" +
id +
"';\n must be one of (\"current\", or a float>=0)";
539 pos = maximumValue + pos;
541 if (pos > maximumValue) {
553 const std::string mode = st.next();
556 }
else if (mode ==
"bicycle") {
558 }
else if (mode ==
"public") {
562 error =
"Unknown person mode '" + mode +
"'. Must be a combination of (\"car\", \"bicycle\" or \"public\")";
564 error =
"Unknown person mode '" + mode +
"' for " + element +
" '" +
id +
"';\n must be a combination of (\"car\", \"bicycle\" or \"public\")";
578 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.
@ ARRIVAL_POS_GIVEN
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.
@ DEPART_POSLAT_RANDOM_FREE
If a fixed number of random choices fails, a free lateral position is chosen.
@ SUMO_ATTR_CONTAINER_STOP
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
@ ARRIVAL_SPEED_DEFAULT
No information given; use default.
RGBColor color
The vehicle's color, TraCI may change this.
@ ARRIVAL_LANE_GIVEN
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.
@ ARRIVAL_POS_RANDOM
The arrival position is chosen randomly.
std::string getDepartSpeed() const
obtain depart speed parameter in string format
@ ARRIVAL_POSLAT_GIVEN
The position is given.
bool hasNext()
returns the information whether further substrings exist
double departSpeed
(optional) The initial speed of the vehicle
@ ARRIVAL_LANE_DEFAULT
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.
@ DEPART_POS_STOP
depart position is endPos of first stop
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.
@ SUMO_ATTR_ARRIVALPOS_LAT
@ DEPART_POSLAT_LEFT
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)
@ DEPART_POS_DEFAULT
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.
@ ARRIVAL_SPEED_CURRENT
The current speed is used.
ArrivalPosLatDefinition
Possible ways to choose the departure position.
@ DEPART_LANE_BEST_FREE
The least occupied lane from best lanes.
@ DEPART_POS_LAST
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)
@ SUMO_ATTR_COLOR
A color information.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
@ SVC_BICYCLE
vehicle is a bicycle
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.
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_ATTR_CHARGING_STATION
const int STOP_EXTENSION_SET
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.
@ DEPART_POSLAT_RIGHT
At the rightmost side of the lane.
const int VEHPARS_DEPARTSPEED_SET
@ DEPART_SPEED_LIMIT
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
@ SUMO_ATTR_BEGIN
weights: time range begin
@ DEPART_LANE_ALLOWED_FREE
The least occupied lane from lanes which allow the continuation.
@ ARRIVAL_POSLAT_DEFAULT
No information given; use default.
const int VEHPARS_ARRIVALLANE_SET
@ SUMO_ATTR_PERSON_NUMBER
std::string line
The vehicle's line (mainly for public transport)
@ DEPART_POSLAT_FREE
A free lateral position is chosen.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
@ DEPART_LANE_RANDOM
The lane is chosen randomly.
@ ARRIVAL_POSLAT_RIGHT
At the rightmost side of the lane.
@ SUMO_TAG_FLOW
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.
@ DEPART_POS_FREE
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
@ DEPART_SPEED_DESIRED
The maximum lane speed is used (speedLimit * speedFactor)
std::string getDepart() const
obtain depart parameter in string format
@ ARRIVAL_POSLAT_LEFT
At the leftmost side of the lane.
const int VEHPARS_COLOR_SET
@ DEPART_SPEED_GIVEN
The speed is given.
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.
@ SUMO_TAG_STOP
stop for vehicles
const std::string DEFAULT_VTYPE_ID
@ SUMO_ATTR_DEPARTPOS_LAT
@ ARRIVAL_POS_DEFAULT
No information given; use default.
@ DEPART_LANE_GIVEN
The lane is given.
@ SVC_PASSENGER
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.
@ SUMO_ATTR_CONTAINER_NUMBER
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)
@ DEPART_TRIGGERED
The departure is person triggered.
const int VEHPARS_ARRIVALPOSLAT_SET
@ ARRIVAL_LANE_CURRENT
The current lane shall be used.
@ DEPART_SPEED_RANDOM
The speed is chosen randomly.
@ DEPART_POS_RANDOM
The position is chosen randomly.
@ ARRIVAL_SPEED_GIVEN
The speed is given.
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.
const int VEHPARS_SPEEDFACTOR_SET
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
@ SUMO_ATTR_EXPECTED_CONTAINERS
const int VEHPARS_DEPARTPOS_SET
@ DEPART_POSLAT_DEFAULT
No information given; use default.
const int VEHPARS_PERSON_NUMBER_SET
const int VEHPARS_FROM_TAZ_SET
@ DEPART_POSLAT_RANDOM
The lateral position is chosen randomly.
@ DEPART_POS_RANDOM_FREE
If a fixed number of random choices fails, a free position is chosen.
@ SUMO_ATTR_CONTAINER_TRIGGERED
const int STOP_DURATION_SET
DepartPosDefinition
Possible ways to choose the departure position.
@ DEPART_GIVEN
The time is given.
@ ARRIVAL_POSLAT_CENTER
At the center of the lane.
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
const int STOP_EXPECTED_SET
@ DEPART_SPEED_MAX
The maximum safe speed is used.
@ DEPART_LANE_DEFAULT
No information given; use default.
const int VEHPARS_TO_TAZ_SET
const int STOP_TRIGGER_SET
const int STOP_CONTAINER_TRIGGER_SET
@ ARRIVAL_POS_MAX
The maximum arrival position is used.
@ DEPART_POS_BASE
Back-at-zero position.
@ DEPART_SPEED_DEFAULT
No information given; use default.
@ SVC_BUS
vehicle is a bus
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)
@ ARRIVAL_POS_CENTER
Half the road length.
@ DEPART_POS_GIVEN
The position is given.
double speedFactor
individual speedFactor (overriding distribution from vType)
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.
@ DEPART_POSLAT_CENTER
At the center of the lane.
@ DEPART_CONTAINER_TRIGGERED
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
@ DEPART_POSLAT_GIVEN
The position is given.
@ DEPART_LANE_FREE
The least occupied lane is used.
@ DEPART_LANE_FIRST_ALLOWED
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.
@ DEPART_NOW
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.