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
39 // set VPH and speed enabled
42 // reset ID
43 id.clear();
44}
45
46
47GNECalibratorFlow::GNECalibratorFlow(GNEAdditional* calibratorParent, const SUMOTime begin, const SUMOTime end,
48 GNEDemandElement* vehicleType, GNEDemandElement* route) :
49 GNEAdditional(calibratorParent, GNE_TAG_CALIBRATOR_FLOW, ""),
51 // set parents
52 setParent<GNEAdditional*>(calibratorParent);
53 setParents<GNEDemandElement*>({vehicleType, route});
54 // update centering boundary without updating grid
56 // reset ID
57 id.clear();
58 // set begin and end
59 depart = begin;
60 repetitionEnd = end;
61 // set default vehsperhour
63}
64
65
67 const SUMOVehicleParameter& vehicleParameters) :
68 GNEAdditional(calibratorParent, GNE_TAG_CALIBRATOR_FLOW, ""),
69 SUMOVehicleParameter(vehicleParameters),
71 // set parents
72 setParent<GNEAdditional*>(calibratorParent);
73 setParents<GNEDemandElement*>({vehicleType, route});
74 // update centering boundary without updating grid
76 // reset ID
77 id.clear();
78}
79
80
82
83
86 return nullptr;
87}
88
89
92 return this;
93}
94
95
96const Parameterised*
98 return this;
99}
100
101
102void
105 // open tag
106 device.openTag(SUMO_TAG_FLOW);
107 // write vehicle attributes
109 // write end
111 // write route
113 // write parameters
115 // close vehicle tag
116 device.closeTag();
117 } else {
118 WRITE_WARNING(TLF("calibratorFlow of calibrator '%' cannot be written. Either type or vehsPerHour or speed must be enabled", getParentAdditionals().front()->getID()));
119 }
120}
121
122
123bool
125 return true;
126}
127
128
129std::string
131 return "";
132}
133
134
135void
137 // nothing to fix
138}
139
140
141bool
143 return false;
144}
145
146
147void
151
152
157
158
159void
161 // nothing to update
162}
163
164
165void
166GNECalibratorFlow::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
167 // geometry of this element cannot be splitted
168}
169
170
171std::string
173 return getParentAdditionals().at(0)->getID();
174}
175
176
177void
179 // draw closing reroute as listed attribute
181 "Flow: " + getID());
182}
183
184
185std::string
187 switch (key) {
188 case SUMO_ATTR_ID:
189 return getMicrosimID();
190 case SUMO_ATTR_TYPE:
191 return vtypeid;
192 case SUMO_ATTR_ROUTE:
193 return getParentDemandElements().at(1)->getID();
196 return toString(3600 / STEPS2TIME(repetitionOffset));
197 } else {
198 return "";
199 }
200 case SUMO_ATTR_SPEED:
203 } else {
204 return "";
205 }
206 case SUMO_ATTR_COLOR:
208 return toString(color);
209 } else {
211 }
212 case SUMO_ATTR_BEGIN:
213 return time2string(depart);
214 case SUMO_ATTR_END:
218 return getDepartLane();
219 } else {
221 }
224 return getDepartPos();
225 } else {
227 }
230 return getDepartSpeed();
231 } else {
233 }
236 return getArrivalLane();
237 } else {
239 }
242 return getArrivalPos();
243 } else {
245 }
248 return getArrivalSpeed();
249 } else {
251 }
252 case SUMO_ATTR_LINE:
254 return line;
255 } else {
257 }
260 return toString(personNumber);
261 } else {
263 }
267 } else {
269 }
272 return "true";
273 } else {
274 return "false";
275 }
278 return getDepartPosLat();
279 } else {
281 }
284 return getArrivalPosLat();
285 } else {
287 }
289 return getInsertionChecks();
290 case GNE_ATTR_PARENT:
291 return getParentAdditionals().at(0)->getID();
292 default:
293 return getCommonAttribute(key);
294 }
295}
296
297
298double
300 switch (key) {
301 case SUMO_ATTR_DEPART:
302 case SUMO_ATTR_BEGIN:
303 case SUMO_ATTR_END:
304 return STEPS2TIME(depart);
306 // only return departPos it if is given
308 return departPos;
309 } else {
310 return 0;
311 }
313 // only return departPos it if is given
315 return arrivalPos;
316 } else {
317 return -1;
318 }
319 case SUMO_ATTR_WIDTH:
320 case SUMO_ATTR_LENGTH:
321 case SUMO_ATTR_MINGAP:
322 return getParentDemandElements().at(0)->getAttributeDouble(key);
323 default:
324 return getCommonAttributeDouble(key);
325 }
326}
327
328
333
334
339
340
341void
342GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
343 if (value == getAttribute(key)) {
344 return; //avoid needless changes, later logic relies on the fact that attributes have changed
345 }
346 switch (key) {
347 case SUMO_ATTR_ID:
348 case SUMO_ATTR_TYPE:
349 case SUMO_ATTR_ROUTE:
350 case SUMO_ATTR_COLOR:
352 case SUMO_ATTR_SPEED:
353 case SUMO_ATTR_BEGIN:
354 case SUMO_ATTR_END:
361 case SUMO_ATTR_LINE:
368 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
369 break;
370 default:
371 setCommonAttribute(key, value, undoList);
372 break;
373 }
374}
375
376
377bool
378GNECalibratorFlow::isValid(SumoXMLAttr key, const std::string& value) {
379 switch (key) {
380 case SUMO_ATTR_ID:
381 return isValidAdditionalID(value);
382 case SUMO_ATTR_TYPE:
383 return (myNet->getAttributeCarriers()->retrieveDemandElements(NamespaceIDs::types, value, false) == nullptr);
384 case SUMO_ATTR_ROUTE:
385 return (myNet->getAttributeCarriers()->retrieveDemandElements(NamespaceIDs::routes, value, false) == nullptr);
387 if (value.empty()) {
388 // speed and vehsPerHour cannot be empty at the same time
390 return false;
391 } else {
392 return true;
393 }
394 } else if (canParse<double>(value)) {
395 const double dVal = parse<double>(value);
396 return (dVal >= 0 || dVal == -1);
397 } else {
398 return false;
399 }
400 case SUMO_ATTR_SPEED:
401 if (value.empty()) {
402 // speed and vehsPerHour cannot be empty at the same time
404 return false;
405 } else {
406 return true;
407 }
408 } else if (canParse<double>(value)) {
409 const double dVal = parse<double>(value);
410 return (dVal >= 0 || dVal == -1);
411 } else {
412 return false;
413 }
414 case SUMO_ATTR_COLOR:
415 return canParse<RGBColor>(value);
416 case SUMO_ATTR_BEGIN:
417 return canParse<SUMOTime>(value);
418 case SUMO_ATTR_END:
419 return canParse<SUMOTime>(value);
421 if ((value == "random") || (value == "free") || (value == "allowed") || (value == "best") || (value == "first")) {
422 return true;
423 } else {
424 return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
425 }
427 if ((value == "random") || (value == "free") || (value == "random_free") || (value == "base") || (value == "last")) {
428 return true;
429 } else {
430 return canParse<double>(value);
431 }
433 if ((value == "random") || (value == "max")) {
434 return true;
435 } else {
436 return canParse<double>(value);
437 }
439 if (value == "current") {
440 return true;
441 } else {
442 return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
443 }
445 if ((value == "random") || (value == "max")) {
446 return true;
447 } else {
448 return canParse<double>(value);
449 }
451 if (value == "current") {
452 return true;
453 } else {
454 return canParse<double>(value);
455 }
456 case SUMO_ATTR_LINE:
457 return true;
459 return canParse<int>(value) && parse<int>(value) >= 0;
461 return canParse<int>(value) && parse<int>(value) >= 0;
463 return canParse<bool>(value);
465 if ((value == "random") || (value == "free") || (value == "random_free") || (value == "left") || (value == "right") || (value == "center")) {
466 return true;
467 } else {
468 return canParse<double>(value);
469 }
471 if ((value == "left") || (value == "right") || (value == "center")) {
472 return true;
473 } else {
474 return canParse<double>(value);
475 }
477 return areInsertionChecksValid(value);
478 default:
479 return isCommonAttributeValid(key, value);
480 }
481}
482
483
484bool
486 switch (key) {
487 case SUMO_ATTR_TYPE:
488 return (parametersSet & VEHPARS_VTYPE_SET) != 0;
490 return (parametersSet & VEHPARS_VPH_SET) != 0;
491 case SUMO_ATTR_SPEED:
493 default:
494 return true;
495 }
496}
497
498
499std::string
501 return getTagStr();
502}
503
504
505std::string
509
510// ===========================================================================
511// private
512// ===========================================================================
513
514void
515GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value) {
516 // declare string error
517 std::string error;
518 switch (key) {
519 case SUMO_ATTR_ID:
520 // update microsimID
521 setAdditionalID(value);
522 break;
523 case SUMO_ATTR_TYPE:
524 if (!isTemplate()) {
525 if (value.empty()) {
527 } else {
529 }
530 }
531 // set manually vtypeID (needed for saving)
532 vtypeid = value;
533 break;
534 case SUMO_ATTR_ROUTE:
536 break;
538 if (value.empty()) {
539 parametersSet &= ~VEHPARS_VPH_SET;
540 } else {
541 repetitionOffset = TIME2STEPS(3600 / parse<double>(value));
542 // set parameters
544 }
545 break;
546 case SUMO_ATTR_SPEED:
547 if (value.empty()) {
548 parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET;
549 } else {
550 calibratorSpeed = parse<double>(value);
551 // mark parameter as set
553 }
554 break;
555 case SUMO_ATTR_COLOR:
556 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
557 color = parse<RGBColor>(value);
558 // mark parameter as set
560 } else {
561 // set default value
563 // unset parameter
564 parametersSet &= ~VEHPARS_COLOR_SET;
565 }
566 break;
567 case SUMO_ATTR_BEGIN:
568 depart = string2time(value);
569 break;
570 case SUMO_ATTR_END:
571 repetitionEnd = string2time(value);
572 break;
574 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
576 // mark parameter as set
578 } else {
579 // set default value
581 // unset parameter
582 parametersSet &= ~VEHPARS_DEPARTLANE_SET;
583 }
584 break;
586 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
588 // mark parameter as set
590 } else {
591 // set default value
593 // unset parameter
594 parametersSet &= ~VEHPARS_DEPARTPOS_SET;
595 }
596 // update geometry (except for template)
597 if (getParentAdditionals().size() > 0) {
599 }
600 break;
602 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
604 // mark parameter as set
606 } else {
607 // set default value
609 // unset parameter
610 parametersSet &= ~VEHPARS_DEPARTSPEED_SET;
611 }
612 break;
614 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
616 // mark parameter as set
618 } else {
619 // set default value
621 // unset parameter
622 parametersSet &= ~VEHPARS_ARRIVALLANE_SET;
623 }
624 break;
626 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
628 // mark parameter as set
630 } else {
631 // set default value
633 // unset parameter
634 parametersSet &= ~VEHPARS_ARRIVALPOS_SET;
635 }
636 // update geometry (except for template)
637 if (getParentAdditionals().size() > 0) {
639 }
640 break;
642 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
644 // mark parameter as set
646 } else {
647 // set default value
649 // unset parameter
650 parametersSet &= ~VEHPARS_ARRIVALSPEED_SET;
651 }
652 break;
653 case SUMO_ATTR_LINE:
654 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
655 line = value;
656 // mark parameter as set
658 } else {
659 // set default value
661 // unset parameter
662 parametersSet &= ~VEHPARS_LINE_SET;
663 }
664 break;
666 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
667 personNumber = parse<int>(value);
668 // mark parameter as set
670 } else {
671 // set default value
673 // unset parameter
674 parametersSet &= ~VEHPARS_PERSON_NUMBER_SET;
675 }
676 break;
678 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
679 containerNumber = parse<int>(value);
680 // mark parameter as set
682 } else {
683 // set default value
685 // unset parameter
686 parametersSet &= ~VEHPARS_CONTAINER_NUMBER_SET;
687 }
688 break;
690 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
691 // mark parameter as set
693 } else {
694 // unset parameter
695 parametersSet &= ~VEHPARS_ROUTE_SET;
696 }
697 break;
699 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
701 // mark parameter as set
703 } else {
704 // set default value
706 // unset parameter
707 parametersSet &= ~VEHPARS_DEPARTPOSLAT_SET;
708 }
709 break;
711 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
713 // mark parameter as set
715 } else {
716 // set default value
718 // unset parameter
719 parametersSet &= ~VEHPARS_ARRIVALPOSLAT_SET;
720 }
722 break;
725 break;
726 default:
727 setCommonAttribute(key, value);
728 break;
729 }
730}
731
732
733void
735 switch (key) {
736 case SUMO_ATTR_TYPE:
737 if (value) {
739 } else {
740 parametersSet &= ~VEHPARS_VTYPE_SET;
741 }
742 break;
744 if (value) {
746 } else {
747 parametersSet &= ~VEHPARS_VPH_SET;
748 }
749 break;
750 case SUMO_ATTR_SPEED:
751 if (value) {
753 } else {
754 parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET;
755 }
756 break;
757 default:
758 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
759 }
760}
761
762/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
@ 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.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:174
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