Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNECalibratorFlow.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18//
19/****************************************************************************/
20#include <config.h>
21
23#include <netedit/GNENet.h>
29
30#include "GNECalibratorFlow.h"
31
32// ===========================================================================
33// member method definitions
34// ===========================================================================
35
37 GNEAdditional("", net, "", GNE_TAG_CALIBRATOR_FLOW, ""),
39 // set VPH and speed enabled
42 // reset ID
43 id.clear();
44}
45
46
48 GNEAdditional(calibratorParent, GNE_TAG_CALIBRATOR_FLOW, ""),
50 // set parents
51 setParent<GNEAdditional*>(calibratorParent);
52 setParents<GNEDemandElement*>({vehicleType, route});
53 // update centering boundary without updating grid
55 // reset ID
56 id.clear();
57}
58
59
61 const SUMOVehicleParameter& vehicleParameters) :
62 GNEAdditional(calibratorParent, GNE_TAG_CALIBRATOR_FLOW, ""),
63 SUMOVehicleParameter(vehicleParameters),
65 // set parents
66 setParent<GNEAdditional*>(calibratorParent);
67 setParents<GNEDemandElement*>({vehicleType, route});
68 // update centering boundary without updating grid
70 // reset ID
71 id.clear();
72}
73
74
76
77
80 return nullptr;
81}
82
83
86 return this;
87}
88
89
90const Parameterised*
92 return this;
93}
94
95
96void
99 // open tag
100 device.openTag(SUMO_TAG_FLOW);
101 // write vehicle attributes
103 // write end
105 // write route
107 // write parameters
109 // close vehicle tag
110 device.closeTag();
111 } else {
112 WRITE_WARNING(TLF("calibratorFlow of calibrator '%' cannot be written. Either type or vehsPerHour or speed must be enabled", getParentAdditionals().front()->getID()));
113 }
114}
115
116
117bool
119 return true;
120}
121
122
123std::string
125 return "";
126}
127
128
129void
131 // nothing to fix
132}
133
134
135bool
137 return false;
138}
139
140
141void
145
146
151
152
153void
155 // nothing to update
156}
157
158
159void
160GNECalibratorFlow::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
161 // geometry of this element cannot be splitted
162}
163
164
165std::string
167 return getParentAdditionals().at(0)->getID();
168}
169
170
171void
173 // draw closing reroute as listed attribute
175 "Flow: " + getID());
176}
177
178
179std::string
181 switch (key) {
182 case SUMO_ATTR_ID:
183 return getMicrosimID();
184 case SUMO_ATTR_TYPE:
185 return vtypeid;
186 case SUMO_ATTR_ROUTE:
187 return getParentDemandElements().at(1)->getID();
190 return toString(3600 / STEPS2TIME(repetitionOffset));
191 } else {
192 return "";
193 }
194 case SUMO_ATTR_SPEED:
197 } else {
198 return "";
199 }
200 case SUMO_ATTR_COLOR:
202 return toString(color);
203 } else {
205 }
206 case SUMO_ATTR_BEGIN:
207 return time2string(depart);
208 case SUMO_ATTR_END:
212 return getDepartLane();
213 } else {
215 }
218 return getDepartPos();
219 } else {
221 }
224 return getDepartSpeed();
225 } else {
227 }
230 return getArrivalLane();
231 } else {
233 }
236 return getArrivalPos();
237 } else {
239 }
242 return getArrivalSpeed();
243 } else {
245 }
246 case SUMO_ATTR_LINE:
248 return line;
249 } else {
251 }
254 return toString(personNumber);
255 } else {
257 }
261 } else {
263 }
266 return "true";
267 } else {
268 return "false";
269 }
272 return getDepartPosLat();
273 } else {
275 }
278 return getArrivalPosLat();
279 } else {
281 }
283 return getInsertionChecks();
284 case GNE_ATTR_PARENT:
285 return getParentAdditionals().at(0)->getID();
286 default:
287 return getCommonAttribute(key);
288 }
289}
290
291
292double
294 switch (key) {
295 case SUMO_ATTR_DEPART:
296 case SUMO_ATTR_BEGIN:
297 case SUMO_ATTR_END:
298 return STEPS2TIME(depart);
300 // only return departPos it if is given
302 return departPos;
303 } else {
304 return 0;
305 }
307 // only return departPos it if is given
309 return arrivalPos;
310 } else {
311 return -1;
312 }
313 case SUMO_ATTR_WIDTH:
314 case SUMO_ATTR_LENGTH:
315 case SUMO_ATTR_MINGAP:
316 return getParentDemandElements().at(0)->getAttributeDouble(key);
317 default:
318 return getCommonAttributeDouble(key);
319 }
320}
321
322
327
328
333
334
335void
336GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
337 if (value == getAttribute(key)) {
338 return; //avoid needless changes, later logic relies on the fact that attributes have changed
339 }
340 switch (key) {
341 case SUMO_ATTR_ID:
342 case SUMO_ATTR_TYPE:
343 case SUMO_ATTR_ROUTE:
344 case SUMO_ATTR_COLOR:
346 case SUMO_ATTR_SPEED:
347 case SUMO_ATTR_BEGIN:
348 case SUMO_ATTR_END:
355 case SUMO_ATTR_LINE:
362 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
363 break;
364 default:
365 setCommonAttribute(key, value, undoList);
366 break;
367 }
368}
369
370
371bool
372GNECalibratorFlow::isValid(SumoXMLAttr key, const std::string& value) {
373 switch (key) {
374 case SUMO_ATTR_ID:
375 return isValidAdditionalID(value);
376 case SUMO_ATTR_TYPE:
377 return (myNet->getAttributeCarriers()->retrieveDemandElements(NamespaceIDs::types, value, false) == nullptr);
378 case SUMO_ATTR_ROUTE:
379 return (myNet->getAttributeCarriers()->retrieveDemandElements(NamespaceIDs::routes, value, false) == nullptr);
381 if (value.empty()) {
382 // speed and vehsPerHour cannot be empty at the same time
384 return false;
385 } else {
386 return true;
387 }
388 } else if (canParse<double>(value)) {
389 const double dVal = parse<double>(value);
390 return (dVal >= 0 || dVal == -1);
391 } else {
392 return false;
393 }
394 case SUMO_ATTR_SPEED:
395 if (value.empty()) {
396 // speed and vehsPerHour cannot be empty at the same time
398 return false;
399 } else {
400 return true;
401 }
402 } else if (canParse<double>(value)) {
403 const double dVal = parse<double>(value);
404 return (dVal >= 0 || dVal == -1);
405 } else {
406 return false;
407 }
408 case SUMO_ATTR_COLOR:
409 return canParse<RGBColor>(value);
410 case SUMO_ATTR_BEGIN:
411 return canParse<SUMOTime>(value);
412 case SUMO_ATTR_END:
413 return canParse<SUMOTime>(value);
415 if ((value == "random") || (value == "free") || (value == "allowed") || (value == "best") || (value == "first")) {
416 return true;
417 } else {
418 return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
419 }
421 if ((value == "random") || (value == "free") || (value == "random_free") || (value == "base") || (value == "last")) {
422 return true;
423 } else {
424 return canParse<double>(value);
425 }
427 if ((value == "random") || (value == "max")) {
428 return true;
429 } else {
430 return canParse<double>(value);
431 }
433 if (value == "current") {
434 return true;
435 } else {
436 return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
437 }
439 if ((value == "random") || (value == "max")) {
440 return true;
441 } else {
442 return canParse<double>(value);
443 }
445 if (value == "current") {
446 return true;
447 } else {
448 return canParse<double>(value);
449 }
450 case SUMO_ATTR_LINE:
451 return true;
453 return canParse<int>(value) && parse<int>(value) >= 0;
455 return canParse<int>(value) && parse<int>(value) >= 0;
457 return canParse<bool>(value);
459 if ((value == "random") || (value == "free") || (value == "random_free") || (value == "left") || (value == "right") || (value == "center")) {
460 return true;
461 } else {
462 return canParse<double>(value);
463 }
465 if ((value == "left") || (value == "right") || (value == "center")) {
466 return true;
467 } else {
468 return canParse<double>(value);
469 }
471 return areInsertionChecksValid(value);
472 default:
473 return isCommonAttributeValid(key, value);
474 }
475}
476
477
478bool
480 switch (key) {
481 case SUMO_ATTR_TYPE:
482 return (parametersSet & VEHPARS_VTYPE_SET) != 0;
484 return (parametersSet & VEHPARS_VPH_SET) != 0;
485 case SUMO_ATTR_SPEED:
487 default:
488 return true;
489 }
490}
491
492
493std::string
495 return getTagStr();
496}
497
498
499std::string
503
504// ===========================================================================
505// private
506// ===========================================================================
507
508void
509GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value) {
510 // declare string error
511 std::string error;
512 switch (key) {
513 case SUMO_ATTR_ID:
514 // update microsimID
515 setAdditionalID(value);
516 break;
517 case SUMO_ATTR_TYPE:
518 if (!isTemplate()) {
519 if (value.empty()) {
521 } else {
523 }
524 }
525 // set manually vtypeID (needed for saving)
526 vtypeid = value;
527 break;
528 case SUMO_ATTR_ROUTE:
530 break;
532 if (value.empty()) {
533 parametersSet &= ~VEHPARS_VPH_SET;
534 } else {
535 repetitionOffset = TIME2STEPS(3600 / parse<double>(value));
536 // set parameters
538 }
539 break;
540 case SUMO_ATTR_SPEED:
541 if (value.empty()) {
542 parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET;
543 } else {
544 calibratorSpeed = parse<double>(value);
545 // mark parameter as set
547 }
548 break;
549 case SUMO_ATTR_COLOR:
550 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
551 color = parse<RGBColor>(value);
552 // mark parameter as set
554 } else {
555 // set default value
557 // unset parameter
558 parametersSet &= ~VEHPARS_COLOR_SET;
559 }
560 break;
561 case SUMO_ATTR_BEGIN:
562 depart = string2time(value);
563 break;
564 case SUMO_ATTR_END:
565 repetitionEnd = string2time(value);
566 break;
568 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
570 // mark parameter as set
572 } else {
573 // set default value
575 // unset parameter
576 parametersSet &= ~VEHPARS_DEPARTLANE_SET;
577 }
578 break;
580 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
582 // mark parameter as set
584 } else {
585 // set default value
587 // unset parameter
588 parametersSet &= ~VEHPARS_DEPARTPOS_SET;
589 }
590 // update geometry (except for template)
591 if (getParentAdditionals().size() > 0) {
593 }
594 break;
596 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
598 // mark parameter as set
600 } else {
601 // set default value
603 // unset parameter
604 parametersSet &= ~VEHPARS_DEPARTSPEED_SET;
605 }
606 break;
608 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
610 // mark parameter as set
612 } else {
613 // set default value
615 // unset parameter
616 parametersSet &= ~VEHPARS_ARRIVALLANE_SET;
617 }
618 break;
620 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
622 // mark parameter as set
624 } else {
625 // set default value
627 // unset parameter
628 parametersSet &= ~VEHPARS_ARRIVALPOS_SET;
629 }
630 // update geometry (except for template)
631 if (getParentAdditionals().size() > 0) {
633 }
634 break;
636 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
638 // mark parameter as set
640 } else {
641 // set default value
643 // unset parameter
644 parametersSet &= ~VEHPARS_ARRIVALSPEED_SET;
645 }
646 break;
647 case SUMO_ATTR_LINE:
648 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
649 line = value;
650 // mark parameter as set
652 } else {
653 // set default value
655 // unset parameter
656 parametersSet &= ~VEHPARS_LINE_SET;
657 }
658 break;
660 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
661 personNumber = parse<int>(value);
662 // mark parameter as set
664 } else {
665 // set default value
667 // unset parameter
668 parametersSet &= ~VEHPARS_PERSON_NUMBER_SET;
669 }
670 break;
672 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
673 containerNumber = parse<int>(value);
674 // mark parameter as set
676 } else {
677 // set default value
679 // unset parameter
680 parametersSet &= ~VEHPARS_CONTAINER_NUMBER_SET;
681 }
682 break;
684 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
685 // mark parameter as set
687 } else {
688 // unset parameter
689 parametersSet &= ~VEHPARS_ROUTE_SET;
690 }
691 break;
693 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
695 // mark parameter as set
697 } else {
698 // set default value
700 // unset parameter
701 parametersSet &= ~VEHPARS_DEPARTPOSLAT_SET;
702 }
703 break;
705 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
707 // mark parameter as set
709 } else {
710 // set default value
712 // unset parameter
713 parametersSet &= ~VEHPARS_ARRIVALPOSLAT_SET;
714 }
716 break;
719 break;
720 default:
721 setCommonAttribute(key, value);
722 break;
723 }
724}
725
726
727void
729 switch (key) {
730 case SUMO_ATTR_TYPE:
731 if (value) {
733 } else {
734 parametersSet &= ~VEHPARS_VTYPE_SET;
735 }
736 break;
738 if (value) {
740 } else {
741 parametersSet &= ~VEHPARS_VPH_SET;
742 }
743 break;
744 case SUMO_ATTR_SPEED:
745 if (value) {
747 } else {
748 parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET;
749 }
750 break;
751 default:
752 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
753 }
754}
755
756/****************************************************************************/
@ VARIABLESPEEDSIGN_STEP
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TLF(string,...)
Definition MsgHandler.h:306
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition SUMOTime.cpp:46
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:91
#define STEPS2TIME(x)
Definition SUMOTime.h:55
#define TIME2STEPS(x)
Definition SUMOTime.h:57
const std::string DEFAULT_VTYPE_ID
const long long int VEHPARS_ARRIVALSPEED_SET
const long long int VEHPARS_DEPARTPOSLAT_SET
const long long int VEHPARS_ARRIVALPOSLAT_SET
const long long int VEHPARS_PERSON_NUMBER_SET
const long long int VEHPARS_DEPARTSPEED_SET
@ GIVEN
The position is given.
const long long int VEHPARS_ROUTE_SET
const long long int VEHPARS_COLOR_SET
const long long int VEHPARS_ARRIVALLANE_SET
const long long int VEHPARS_DEPARTLANE_SET
const long long int VEHPARS_DEPARTPOS_SET
const long long int VEHPARS_ARRIVALPOS_SET
const long long int VEHPARS_CONTAINER_NUMBER_SET
const long long int VEHPARS_VTYPE_SET
const long long int VEHPARS_VPH_SET
@ GIVEN
The arrival position is given.
const long long int VEHPARS_CALIBRATORSPEED_SET
const long long int VEHPARS_LINE_SET
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_ROUTE
description of a route
@ GNE_TAG_CALIBRATOR_FLOW
a flow definition within in Calibrator
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_ARRIVALSPEED
@ SUMO_ATTR_ARRIVALLANE
@ SUMO_ATTR_DEPART
@ SUMO_ATTR_VEHSPERHOUR
@ SUMO_ATTR_SPEED
@ SUMO_ATTR_DEPARTPOS_LAT
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_ARRIVALPOS
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_MINGAP
@ SUMO_ATTR_CONTAINER_NUMBER
@ SUMO_ATTR_LINE
@ SUMO_ATTR_DEPARTPOS
@ SUMO_ATTR_REROUTE
@ SUMO_ATTR_DEPARTSPEED
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_DEPARTLANE
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ROUTE
@ SUMO_ATTR_PERSON_NUMBER
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_ID
@ SUMO_ATTR_ARRIVALPOS_LAT
@ SUMO_ATTR_INSERTIONCHECKS
@ SUMO_ATTR_WIDTH
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
void setAdditionalID(const std::string &newID)
set additional ID
void replaceDemandElementParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace demand element parent
void drawListedAdditional(const GUIVisualizationSettings &s, const RGBColor baseCol, const RGBColor textCol, GUITexture texture, const std::string text) const
draw listed additional
Position getListedPositionInView() const
get listed position in view
void updateGeometryListedAdditional()
update geometry of listed additional
double getCommonAttributeDouble(SumoXMLAttr key) const
const std::string getID() const override
get ID (all Attribute Carriers have one)
PositionVector getCommonAttributePositionVector(SumoXMLAttr key) const
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
const std::string & getTagStr() const
get tag assigned to this object in string format
bool isTemplate() const
check if this AC is template
Position getCommonAttributePosition(SumoXMLAttr key) const
GNENet * myNet
pointer to net
bool isCommonAttributeValid(SumoXMLAttr key, const std::string &value) const
std::string getCommonAttribute(SumoXMLAttr key) const
const GNETagProperties * myTagProperty
reference to tagProperty associated with this attribute carrier
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
bool isAttributeEnabled(SumoXMLAttr key) const override
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
GNECalibratorFlow(GNENet *net)
default constructor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Position getAttributePosition(SumoXMLAttr key) const override
~GNECalibratorFlow()
destructor
void toggleAttribute(SumoXMLAttr key, const bool value) override
toggle attribute
bool checkDrawMoveContour() const override
check if draw move contour (red)
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
Position getPositionInView() const override
Returns position of additional in view.
void updateGeometry() override
update pre-computed geometry information
double getAttributeDouble(SumoXMLAttr key) const override
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
bool isValid(SumoXMLAttr key, const std::string &value) override
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this calibratorFlow
std::string getParentName() const override
Returns the name of the parent object.
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Parameterised * getParameters() override
get parameters associated with this calibratorFlow
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEDemandElement * retrieveDemandElements(const std::vector< SumoXMLTag > types, const std::string &id, bool hardFail=true) const
Returns the named demand element.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:144
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
const RGBColor & getDefaultColorValue(SumoXMLAttr attr) const
get default bool value
int getDefaultIntValue(SumoXMLAttr attr) const
get default int value
const std::string & getDefaultStringValue(SumoXMLAttr attr) const
default values
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Stores the information about how to visualize structures.
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
static const std::vector< SumoXMLTag > types
type namespace
static const std::vector< SumoXMLTag > routes
route namespace
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
An upper class for objects with additional parameters.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
static const RGBColor BLACK
Definition RGBColor.h:196
Structure representing possible vehicle parameter.
double departPosLat
(optional) The lateral position the vehicle shall depart from
double arrivalPosLat
(optional) The lateral position the vehicle shall arrive on
std::string getArrivalSpeed() const
obtain arrival speed parameter in string format
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
double departSpeed
(optional) The initial speed of the vehicle
std::string vtypeid
The vehicle's type id.
std::string getDepartLane() const
obtain depart lane parameter in string format
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
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.
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.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
long long int parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color)
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag altTag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
Writes the parameters as a beginning element.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
std::string getArrivalLane() const
obtain arrival lane parameter in string format
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.
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.
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons)
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.
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
bool wasSet(long long int what) const
Returns whether the given parameter was set.
std::string getDepartSpeed() const
obtain depart speed parameter in string format
std::string getArrivalPos() const
obtain arrival pos parameter in string format
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
RGBColor color
The vehicle's color, TraCI may change this.
bool areInsertionChecksValid(const std::string &value) const
check if given insertion checks are valid
double arrivalPos
(optional) The position the vehicle shall arrive on
static int parseInsertionChecks(const std::string &value)
parses insertion checks
double calibratorSpeed
speed (used by calibrator flows
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.
std::string getInsertionChecks() const
get insertion checks in string format
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
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.
std::string getDepartPosLat() const
obtain depart pos lat parameter in string format
std::string getArrivalPosLat() const
obtain arrival pos lat parameter in string format
std::string getDepartPos() const
obtain depart pos parameter in string format
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
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.
int insertionChecks
bitset of InsertionCheck
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
std::string line
The vehicle's line (mainly for public transport)
int containerNumber
The static number of containers in the vehicle when it departs.
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
static const RGBColor calibratorColor
color for Calibrators