40 #ifdef CHECK_MEMORY_LEAKS
42 #endif // CHECK_MEMORY_LEAKS
57 repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1),
58 line(), fromTaz(), toTaz(), personCapacity(0), personNumber(0), setParameter(0) {
64 return oc.
isSet(optionName) && oc.
getBool(
"defaults-override");
105 }
else if (oc.
isSet(
"departlane")) {
141 }
else if (oc.
isSet(
"departpos")) {
162 }
else if (oc.
isSet(
"departspeed")) {
181 }
else if (oc.
isSet(
"arrivallane")) {
202 }
else if (oc.
isSet(
"arrivalpos")) {
220 }
else if (oc.
isSet(
"arrivalspeed")) {
245 for (std::vector<Stop>::const_iterator stop =
stops.begin(); stop !=
stops.end(); ++stop) {
247 if (stop->busstop !=
"") {
258 if (stop->duration >= 0) {
261 if (stop->until >= 0) {
285 if (val ==
"triggered") {
287 }
else if (val ==
"now") {
294 error =
"Negative departure time in the definition of '" +
id +
"'.";
298 error =
"Invalid departure time for " + element +
" '" +
id +
"';\n must be one of (\"triggered\", \"now\", or a float >= 0)";
310 if (val ==
"random") {
312 }
else if (val ==
"free") {
314 }
else if (val ==
"allowed") {
316 }
else if (val ==
"best") {
330 error =
"Invalid departLane definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", or an int>=0)";
340 if (val ==
"random") {
342 }
else if (val ==
"random_free") {
344 }
else if (val ==
"free") {
346 }
else if (val ==
"base") {
348 }
else if (val ==
"pwagSimple") {
350 }
else if (val ==
"pwagGeneric") {
352 }
else if (val ==
"maxSpeedGap") {
363 error =
"Invalid departPos definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"pwagSimple\", \"pwagGeneric\", \"maxSpeedGap\", or a float)";
373 if (val ==
"random") {
375 }
else if (val ==
"max") {
389 error =
"Invalid departSpeed definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"max\", or a float>=0)";
399 if (val ==
"current") {
413 error =
"Invalid arrivalLane definition for " + element +
" '" +
id +
"';\n must be one of (\"current\", or an int>=0)";
423 if (val ==
"random") {
425 }
else if (val ==
"max") {
436 error =
"Invalid arrivalPos definition for " + element +
" '" +
id +
"';\n must be one of (\"random\", \"max\", or a float)";
446 if (val ==
"current") {
460 error =
"Invalid arrivalSpeed definition for " + element +
" '" +
id +
"';\n must be one of (\"current\", or a float>=0)";
469 pos = maximumValue + pos;
471 if (pos > maximumValue) {
The departure is person triggered.
The current lane shall be used.
No information given; use default.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
RGBColor color
The vehicle's color.
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.
void writeStops(OutputDevice &dev) const
Writes the enclosed stops.
static SUMOReal _2SUMOReal(const E *const data)
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
SUMOReal departSpeed
(optional) The initial speed of the vehicle
unsigned int personCapacity
The vehicle's capacity (persons)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
SUMOReal arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
The least occupied lane is used.
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.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
The lane is chosen randomly.
unsigned int personNumber
The number of persons in the vehicle.
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
The arrival position is given.
const std::string DEFAULT_VTYPE_ID
The least occupied lane from best lanes.
The position is chosen randomly.
Generic max-flow insertion by P.Wagner.
#define WRITE_WARNING(msg)
A gap is chosen where the maximum speed may be achieved.
std::string toTaz
The vehicle's destination zone (district)
std::vector< Stop > stops
List of the stops the vehicle will make.
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.
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.
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" ...
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.
int arrivalLane
(optional) The lane the vehicle shall arrive on (not used yet)
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)
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.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
const int VEHPARS_COLOR_SET
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.
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_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)
const int STOP_TRIGGER_SET
A storage for options typed value containers)
const int VEHPARS_DEPARTLANE_SET
No information given; use default.
The arrival lane is given.
SUMOReal departPos
(optional) The position the vehicle shall depart from
void write(OutputDevice &dev, const OptionsCont &oc) const
Writes the parameters as a beginning element.
const int VEHPARS_TAZ_SET
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
Simple max-flow insertion by P.Wagner.
const int VEHPARS_PERSON_NUMBER_SET
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
DepartPosDefinition
Possible ways to choose the departure position.
The maximum arrival position is used.
const int VEHPARS_PERSON_CAPACITY_SET
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 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.