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
22#include <netedit/GNENet.h>
28
29#include "GNECalibratorFlow.h"
30
31// ===========================================================================
32// member method definitions
33// ===========================================================================
34
36 GNEAdditional("", net, "", GNE_TAG_CALIBRATOR_FLOW, ""),
38 // set VPH and speed enabled
41 // reset ID
42 id.clear();
43}
44
45
47 GNEAdditional(calibratorParent, GNE_TAG_CALIBRATOR_FLOW, ""),
49 // set parents
50 setParent<GNEAdditional*>(calibratorParent);
51 setParents<GNEDemandElement*>({vehicleType, route});
52 // update centering boundary without updating grid
54 // reset ID
55 id.clear();
56}
57
58
60 const SUMOVehicleParameter& vehicleParameters) :
61 GNEAdditional(calibratorParent, GNE_TAG_CALIBRATOR_FLOW, ""),
62 SUMOVehicleParameter(vehicleParameters),
64 // set parents
65 setParent<GNEAdditional*>(calibratorParent);
66 setParents<GNEDemandElement*>({vehicleType, route});
67 // update centering boundary without updating grid
69 // reset ID
70 id.clear();
71}
72
73
75
76
79 return nullptr;
80}
81
82
85 return this;
86}
87
88
89const Parameterised*
91 return this;
92}
93
94
95void
98 // open tag
99 device.openTag(SUMO_TAG_FLOW);
100 // write vehicle attributes
102 // write end
104 // write route
106 // write parameters
108 // close vehicle tag
109 device.closeTag();
110 } else {
111 WRITE_WARNING(TLF("calibratorFlow of calibrator '%' cannot be written. Either type or vehsPerHour or speed must be enabled", getParentAdditionals().front()->getID()));
112 }
113}
114
115
116bool
118 return true;
119}
120
121
122std::string
124 return "";
125}
126
127
128void
130 // nothing to fix
131}
132
133
134bool
136 return false;
137}
138
139
140void
144
145
150
151
152void
154 // nothing to update
155}
156
157
158void
159GNECalibratorFlow::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
160 // geometry of this element cannot be splitted
161}
162
163
164std::string
166 return getParentAdditionals().at(0)->getID();
167}
168
169
170void
172 // draw closing reroute as listed attribute
174 "Flow: " + getID());
175}
176
177
178std::string
180 switch (key) {
181 case SUMO_ATTR_ID:
182 return getMicrosimID();
183 case SUMO_ATTR_TYPE:
184 return vtypeid;
185 case SUMO_ATTR_ROUTE:
186 return getParentDemandElements().at(1)->getID();
189 return toString(3600 / STEPS2TIME(repetitionOffset));
190 } else {
191 return "";
192 }
193 case SUMO_ATTR_SPEED:
196 } else {
197 return "";
198 }
199 case SUMO_ATTR_COLOR:
201 return toString(color);
202 } else {
204 }
205 case SUMO_ATTR_BEGIN:
206 return time2string(depart);
207 case SUMO_ATTR_END:
211 return getDepartLane();
212 } else {
214 }
217 return getDepartPos();
218 } else {
220 }
223 return getDepartSpeed();
224 } else {
226 }
229 return getArrivalLane();
230 } else {
232 }
235 return getArrivalPos();
236 } else {
238 }
241 return getArrivalSpeed();
242 } else {
244 }
245 case SUMO_ATTR_LINE:
247 return line;
248 } else {
250 }
253 return toString(personNumber);
254 } else {
256 }
260 } else {
262 }
265 return "true";
266 } else {
267 return "false";
268 }
271 return getDepartPosLat();
272 } else {
274 }
277 return getArrivalPosLat();
278 } else {
280 }
282 return getInsertionChecks();
283 case GNE_ATTR_PARENT:
284 return getParentAdditionals().at(0)->getID();
285 default:
286 return getCommonAttribute(key);
287 }
288}
289
290
291double
293 switch (key) {
294 case SUMO_ATTR_DEPART:
295 case SUMO_ATTR_BEGIN:
296 case SUMO_ATTR_END:
297 return STEPS2TIME(depart);
299 // only return departPos it if is given
301 return departPos;
302 } else {
303 return 0;
304 }
306 // only return departPos it if is given
308 return arrivalPos;
309 } else {
310 return -1;
311 }
312 case SUMO_ATTR_WIDTH:
313 case SUMO_ATTR_LENGTH:
314 case SUMO_ATTR_MINGAP:
315 return getParentDemandElements().at(0)->getAttributeDouble(key);
316 default:
317 return getCommonAttributeDouble(key);
318 }
319}
320
321
326
327
332
333
334void
335GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
336 if (value == getAttribute(key)) {
337 return; //avoid needless changes, later logic relies on the fact that attributes have changed
338 }
339 switch (key) {
340 case SUMO_ATTR_ID:
341 case SUMO_ATTR_TYPE:
342 case SUMO_ATTR_ROUTE:
343 case SUMO_ATTR_COLOR:
345 case SUMO_ATTR_SPEED:
346 case SUMO_ATTR_BEGIN:
347 case SUMO_ATTR_END:
354 case SUMO_ATTR_LINE:
361 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
362 break;
363 default:
364 setCommonAttribute(key, value, undoList);
365 break;
366 }
367}
368
369
370bool
371GNECalibratorFlow::isValid(SumoXMLAttr key, const std::string& value) {
372 switch (key) {
373 case SUMO_ATTR_ID:
374 return isValidAdditionalID(value);
375 case SUMO_ATTR_TYPE:
376 return (myNet->getAttributeCarriers()->retrieveDemandElements(NamespaceIDs::types, value, false) == nullptr);
377 case SUMO_ATTR_ROUTE:
378 return (myNet->getAttributeCarriers()->retrieveDemandElements(NamespaceIDs::routes, value, false) == nullptr);
380 if (value.empty()) {
381 // speed and vehsPerHour cannot be empty at the same time
383 return false;
384 } else {
385 return true;
386 }
387 } else if (canParse<double>(value)) {
388 const double dVal = parse<double>(value);
389 return (dVal >= 0 || dVal == -1);
390 } else {
391 return false;
392 }
393 case SUMO_ATTR_SPEED:
394 if (value.empty()) {
395 // speed and vehsPerHour cannot be empty at the same time
397 return false;
398 } else {
399 return true;
400 }
401 } else if (canParse<double>(value)) {
402 const double dVal = parse<double>(value);
403 return (dVal >= 0 || dVal == -1);
404 } else {
405 return false;
406 }
407 case SUMO_ATTR_COLOR:
408 return canParse<RGBColor>(value);
409 case SUMO_ATTR_BEGIN:
410 return canParse<SUMOTime>(value);
411 case SUMO_ATTR_END:
412 return canParse<SUMOTime>(value);
414 if ((value == "random") || (value == "free") || (value == "allowed") || (value == "best") || (value == "first")) {
415 return true;
416 } else {
417 return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
418 }
420 if ((value == "random") || (value == "free") || (value == "random_free") || (value == "base") || (value == "last")) {
421 return true;
422 } else {
423 return canParse<double>(value);
424 }
426 if ((value == "random") || (value == "max")) {
427 return true;
428 } else {
429 return canParse<double>(value);
430 }
432 if (value == "current") {
433 return true;
434 } else {
435 return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
436 }
438 if ((value == "random") || (value == "max")) {
439 return true;
440 } else {
441 return canParse<double>(value);
442 }
444 if (value == "current") {
445 return true;
446 } else {
447 return canParse<double>(value);
448 }
449 case SUMO_ATTR_LINE:
450 return true;
452 return canParse<int>(value) && parse<int>(value) >= 0;
454 return canParse<int>(value) && parse<int>(value) >= 0;
456 return canParse<bool>(value);
458 if ((value == "random") || (value == "free") || (value == "random_free") || (value == "left") || (value == "right") || (value == "center")) {
459 return true;
460 } else {
461 return canParse<double>(value);
462 }
464 if ((value == "left") || (value == "right") || (value == "center")) {
465 return true;
466 } else {
467 return canParse<double>(value);
468 }
470 return areInsertionChecksValid(value);
471 default:
472 return isCommonAttributeValid(key, value);
473 }
474}
475
476
477bool
479 switch (key) {
480 case SUMO_ATTR_TYPE:
481 return (parametersSet & VEHPARS_VTYPE_SET) != 0;
483 return (parametersSet & VEHPARS_VPH_SET) != 0;
484 case SUMO_ATTR_SPEED:
486 default:
487 return true;
488 }
489}
490
491
492std::string
494 return getTagStr();
495}
496
497
498std::string
502
503// ===========================================================================
504// private
505// ===========================================================================
506
507void
508GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value) {
509 // declare string error
510 std::string error;
511 switch (key) {
512 case SUMO_ATTR_ID:
513 // update microsimID
514 setAdditionalID(value);
515 break;
516 case SUMO_ATTR_TYPE:
517 if (!isTemplate()) {
518 if (value.empty()) {
520 } else {
522 }
523 }
524 // set manually vtypeID (needed for saving)
525 vtypeid = value;
526 break;
527 case SUMO_ATTR_ROUTE:
529 break;
531 if (value.empty()) {
532 parametersSet &= ~VEHPARS_VPH_SET;
533 } else {
534 repetitionOffset = TIME2STEPS(3600 / parse<double>(value));
535 // set parameters
537 }
538 break;
539 case SUMO_ATTR_SPEED:
540 if (value.empty()) {
541 parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET;
542 } else {
543 calibratorSpeed = parse<double>(value);
544 // mark parameter as set
546 }
547 break;
548 case SUMO_ATTR_COLOR:
549 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
550 color = parse<RGBColor>(value);
551 // mark parameter as set
553 } else {
554 // set default value
556 // unset parameter
557 parametersSet &= ~VEHPARS_COLOR_SET;
558 }
559 break;
560 case SUMO_ATTR_BEGIN:
561 depart = string2time(value);
562 break;
563 case SUMO_ATTR_END:
564 repetitionEnd = string2time(value);
565 break;
567 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
569 // mark parameter as set
571 } else {
572 // set default value
574 // unset parameter
575 parametersSet &= ~VEHPARS_DEPARTLANE_SET;
576 }
577 break;
579 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
581 // mark parameter as set
583 } else {
584 // set default value
586 // unset parameter
587 parametersSet &= ~VEHPARS_DEPARTPOS_SET;
588 }
589 // update geometry (except for template)
590 if (getParentAdditionals().size() > 0) {
592 }
593 break;
595 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
597 // mark parameter as set
599 } else {
600 // set default value
602 // unset parameter
603 parametersSet &= ~VEHPARS_DEPARTSPEED_SET;
604 }
605 break;
607 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
609 // mark parameter as set
611 } else {
612 // set default value
614 // unset parameter
615 parametersSet &= ~VEHPARS_ARRIVALLANE_SET;
616 }
617 break;
619 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
621 // mark parameter as set
623 } else {
624 // set default value
626 // unset parameter
627 parametersSet &= ~VEHPARS_ARRIVALPOS_SET;
628 }
629 // update geometry (except for template)
630 if (getParentAdditionals().size() > 0) {
632 }
633 break;
635 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
637 // mark parameter as set
639 } else {
640 // set default value
642 // unset parameter
643 parametersSet &= ~VEHPARS_ARRIVALSPEED_SET;
644 }
645 break;
646 case SUMO_ATTR_LINE:
647 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
648 line = value;
649 // mark parameter as set
651 } else {
652 // set default value
654 // unset parameter
655 parametersSet &= ~VEHPARS_LINE_SET;
656 }
657 break;
659 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
660 personNumber = parse<int>(value);
661 // mark parameter as set
663 } else {
664 // set default value
666 // unset parameter
667 parametersSet &= ~VEHPARS_PERSON_NUMBER_SET;
668 }
669 break;
671 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
672 containerNumber = parse<int>(value);
673 // mark parameter as set
675 } else {
676 // set default value
678 // unset parameter
679 parametersSet &= ~VEHPARS_CONTAINER_NUMBER_SET;
680 }
681 break;
683 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
684 // mark parameter as set
686 } else {
687 // unset parameter
688 parametersSet &= ~VEHPARS_ROUTE_SET;
689 }
690 break;
692 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
694 // mark parameter as set
696 } else {
697 // set default value
699 // unset parameter
700 parametersSet &= ~VEHPARS_DEPARTPOSLAT_SET;
701 }
702 break;
704 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
706 // mark parameter as set
708 } else {
709 // set default value
711 // unset parameter
712 parametersSet &= ~VEHPARS_ARRIVALPOSLAT_SET;
713 }
715 break;
718 break;
719 default:
720 setCommonAttribute(key, value);
721 break;
722 }
723}
724
725
726void
728 switch (key) {
729 case SUMO_ATTR_TYPE:
730 if (value) {
732 } else {
733 parametersSet &= ~VEHPARS_VTYPE_SET;
734 }
735 break;
737 if (value) {
739 } else {
740 parametersSet &= ~VEHPARS_VPH_SET;
741 }
742 break;
743 case SUMO_ATTR_SPEED:
744 if (value) {
746 } else {
747 parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET;
748 }
749 break;
750 default:
751 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
752 }
753}
754
755/****************************************************************************/
@ 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
const std::string getID() const
get ID (all Attribute Carriers have one)
double getCommonAttributeDouble(SumoXMLAttr key) const
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)
void fixAdditionalProblem()
fix 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)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position getAttributePosition(SumoXMLAttr key) const override
void toggleAttribute(SumoXMLAttr key, const bool value)
toggle attribute
~GNECalibratorFlow()
destructor
bool checkDrawMoveContour() const override
check if draw move contour (red)
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void updateGeometry() override
update pre-computed geometry information
double getAttributeDouble(SumoXMLAttr key) const override
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
Position getPositionInView() const
Returns position of additional in view.
bool isAttributeEnabled(SumoXMLAttr key) const
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
bool isValid(SumoXMLAttr key, const std::string &value) override
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this calibratorFlow
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
std::string getParentName() const
Returns the name of the parent object.
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