40 #ifdef CHECK_MEMORY_LEAKS 42 #endif // CHECK_MEMORY_LEAKS 59 repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
60 line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0), setParameter(0) {
68 return oc.
exists(optionName) && oc.
isSet(optionName) && oc.
getBool(
"defaults-override");
118 }
else if (oc.
exists(
"departlane") && oc.
isSet(
"departlane")) {
148 }
else if (oc.
exists(
"departpos") && oc.
isSet(
"departpos")) {
200 }
else if (oc.
exists(
"departspeed") && oc.
isSet(
"departspeed")) {
219 }
else if (oc.
exists(
"arrivallane") && oc.
isSet(
"arrivallane")) {
240 }
else if (oc.
exists(
"arrivalpos") && oc.
isSet(
"arrivalpos")) {
280 }
else if (oc.
exists(
"arrivalspeed") && oc.
isSet(
"arrivalspeed")) {
312 if (containerstop !=
"") {
315 if (parkingarea !=
"") {
318 if (busstop ==
"" && containerstop ==
"" && parkingarea ==
"") {
359 if (val ==
"triggered") {
361 }
else if (val ==
"containerTriggered") {
363 }
else if (val ==
"now") {
370 error =
"Negative departure time in the definition of '" +
id +
"'.";
374 error =
"Invalid departure time for " + element +
" '" +
id +
"';\n must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
386 if (val ==
"random") {
388 }
else if (val ==
"free") {
390 }
else if (val ==
"allowed") {
392 }
else if (val ==
"best") {
394 }
else if (val ==
"first") {
408 error =
"Invalid departLane definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
418 if (val ==
"random") {
420 }
else if (val ==
"random_free") {
422 }
else if (val ==
"free") {
424 }
else if (val ==
"base") {
426 }
else if (val ==
"last") {
437 error =
"Invalid departPos definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
447 if (val ==
"random") {
449 }
else if (val ==
"random_free") {
451 }
else if (val ==
"free") {
453 }
else if (val ==
"right") {
455 }
else if (val ==
"center") {
457 }
else if (val ==
"left") {
468 error =
"Invalid departPosLat definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
478 if (val ==
"random") {
480 }
else if (val ==
"max") {
494 error =
"Invalid departSpeed definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"max\", or a float>=0)";
504 if (val ==
"current") {
518 error =
"Invalid arrivalLane definition for " + element +
" '" +
id +
"';\n must be one of (\"current\", or an int>=0)";
528 if (val ==
"random") {
530 }
else if (val ==
"max") {
541 error =
"Invalid arrivalPos definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"max\", or a float)";
551 if (val ==
"right") {
553 }
else if (val ==
"center") {
555 }
else if (val ==
"left") {
566 error =
"Invalid arrivalPosLat definition for " + element +
" '" +
id +
"';\n must be one of (\"right\", \"center\", \"left\", or a float)";
576 if (val ==
"current") {
590 error =
"Invalid arrivalSpeed definition for " + element +
" '" +
id +
"';\n must be one of (\"current\", or a float>=0)";
599 pos = maximumValue + pos;
601 if (pos > maximumValue) {
The departure is person triggered.
const int VEHPARS_TO_TAZ_SET
The current lane shall be used.
const int STOP_CONTAINER_TRIGGER_SET
~SUMOVehicleParameter()
Destructor.
No information given; use default.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
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.
SumoXMLTag
Numbers representing SUMO-XML - element names.
RGBColor color
The vehicle's color, TraCI may change this.
A free lateral position is chosen.
At the leftmost side of the lane.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, SUMOReal &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
The vehicle is discarded if emission fails (not fully implemented yet)
std::string vtypeid
The vehicle's type id.
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, SUMOReal &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
static SUMOReal _2SUMOReal(const E *const data)
converts a char-type array into the SUMOReal value described by it
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.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
SUMOReal departSpeed
(optional) The initial speed of the vehicle
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
The lateral position is chosen randomly.
SUMOReal arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
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)
SUMOReal arrivalPos
(optional) The position the vehicle shall arrive on
const int VEHPARS_ARRIVALLANE_SET
The speed is chosen randomly.
void write(OutputDevice &dev) const
Writes the stop as XML.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
The lane is chosen randomly.
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
The arrival position is given.
ArrivalPosLatDefinition
Possible ways to choose the departure position.
const std::string DEFAULT_VTYPE_ID
The least occupied lane from best lanes.
The position is chosen randomly.
#define WRITE_WARNING(msg)
std::string toTaz
The vehicle's destination zone (district)
const int VEHPARS_ARRIVALSPEED_SET
static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
SUMOVehicleParameter()
Constructor.
No information given; use default.
bool defaultOptionOverrides(const OptionsCont &oc, const std::string &optionName) const
Returns whether the defaults shall be used.
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.
bool wasSet(int what) const
Returns whether the given parameter was set.
const int VEHPARS_DEPARTSPEED_SET
The current speed is used.
At the rightmost side of the lane.
int arrivalLane
(optional) The lane the vehicle shall arrive on (not used yet)
const int VEHPARS_DEPARTPOSLAT_SET
SUMOTime depart
The vehicle's departure time.
The maximum speed is used.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOTime string2time(const std::string &r)
virtual bool ok()
returns the information whether one can write into the device
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.
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.
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, SUMOReal &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
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)
DepartSpeedDefinition
Possible ways to choose the departure speed.
const int VEHPARS_ARRIVALPOSLAT_SET
const int VEHPARS_LINE_SET
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, SUMOReal &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
const int VEHPARS_ARRIVALPOS_SET
No information given; use default.
const int STOP_PARKING_SET
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
const int STOP_TRIGGER_SET
const int STOP_EXPECTED_CONTAINERS_SET
int setParameter
Information for the router which parameter were set, TraCI may modify this (whe changing color) ...
At the rightmost side of the lane.
At the center of the lane.
A storage for options typed value containers)
const int VEHPARS_DEPARTLANE_SET
No information given; use default.
The arrival lane is given.
int containerNumber
The static number of containers in the vehicle when it departs.
No information given; use default.
SUMOReal departPos
(optional) The position the vehicle shall depart from
static bool parseDepartPosLat(const std::string &val, const std::string &element, const std::string &id, SUMOReal &pos, DepartPosLatDefinition &dpd, std::string &error)
Validates a given departPosLat value.
static bool parseArrivalPosLat(const std::string &val, const std::string &element, const std::string &id, SUMOReal &pos, ArrivalPosLatDefinition &apd, std::string &error)
Validates a given arrivalPosLat value.
const int VEHPARS_VTYPE_SET
No information given; use default.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
ArrivalPosDefinition
Possible ways to choose the arrival position.
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.
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.
bool exists(const std::string &name) const
Returns the information whether the named option is known.
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
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.