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-2026 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 {
210 return myTagProperty->getDefaultStringValue(SUMO_ATTR_COLOR);
211 }
212 case SUMO_ATTR_BEGIN:
213 return time2string(depart);
214 case SUMO_ATTR_END:
218 return getDepartLane();
219 } else {
220 return myTagProperty->getDefaultStringValue(SUMO_ATTR_DEPARTLANE);
221 }
224 return getDepartPos();
225 } else {
226 return myTagProperty->getDefaultStringValue(SUMO_ATTR_DEPARTPOS);
227 }
230 return getDepartSpeed();
231 } else {
232 return myTagProperty->getDefaultStringValue(SUMO_ATTR_DEPARTSPEED);
233 }
236 return getArrivalLane();
237 } else {
238 return myTagProperty->getDefaultStringValue(SUMO_ATTR_ARRIVALLANE);
239 }
242 return getArrivalPos();
243 } else {
244 return myTagProperty->getDefaultStringValue(SUMO_ATTR_ARRIVALPOS);
245 }
248 return getArrivalSpeed();
249 } else {
250 return myTagProperty->getDefaultStringValue(SUMO_ATTR_ARRIVALSPEED);
251 }
252 case SUMO_ATTR_LINE:
254 return line;
255 } else {
256 return myTagProperty->getDefaultStringValue(SUMO_ATTR_LINE);
257 }
260 return toString(personNumber);
261 } else {
262 return myTagProperty->getDefaultStringValue(SUMO_ATTR_PERSON_NUMBER);
263 }
267 } else {
268 return myTagProperty->getDefaultStringValue(SUMO_ATTR_CONTAINER_NUMBER);
269 }
272 return "true";
273 } else {
274 return "false";
275 }
278 return getDepartPosLat();
279 } else {
280 return myTagProperty->getDefaultStringValue(SUMO_ATTR_DEPARTPOS_LAT);
281 }
284 return getArrivalPosLat();
285 } else {
286 return myTagProperty->getDefaultStringValue(SUMO_ATTR_ARRIVALPOS_LAT);
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
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
379 switch (key) {
380 case SUMO_ATTR_ID:
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:
416 case SUMO_ATTR_BEGIN:
418 case SUMO_ATTR_END:
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 }
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
516 // declare string error
517 std::string error;
518 switch (key) {
519 case SUMO_ATTR_ID:
520 // update microsimID
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()) {
540 } else {
542 // set parameters
544 }
545 break;
546 case SUMO_ATTR_SPEED:
547 if (value.empty()) {
549 } else {
551 // mark parameter as set
553 }
554 break;
555 case SUMO_ATTR_COLOR:
556 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
558 // mark parameter as set
560 } else {
561 // set default value
562 color = myTagProperty->getDefaultColorValue(key);
563 // unset parameter
565 }
566 break;
567 case SUMO_ATTR_BEGIN:
569 break;
570 case SUMO_ATTR_END:
572 break;
574 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
576 // mark parameter as set
578 } else {
579 // set default value
580 parseDepartLane(myTagProperty->getDefaultStringValue(key), myTagProperty->getTagStr(), id, departLane, departLaneProcedure, error);
581 // unset parameter
583 }
584 break;
586 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
588 // mark parameter as set
590 } else {
591 // set default value
592 parseDepartPos(myTagProperty->getDefaultStringValue(key), myTagProperty->getTagStr(), id, departPos, departPosProcedure, error);
593 // unset parameter
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
608 parseDepartSpeed(myTagProperty->getDefaultStringValue(key), myTagProperty->getTagStr(), id, departSpeed, departSpeedProcedure, error);
609 // unset parameter
611 }
612 break;
614 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
616 // mark parameter as set
618 } else {
619 // set default value
620 parseArrivalLane(myTagProperty->getDefaultStringValue(key), myTagProperty->getTagStr(), id, arrivalLane, arrivalLaneProcedure, error);
621 // unset parameter
623 }
624 break;
626 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
628 // mark parameter as set
630 } else {
631 // set default value
632 parseArrivalPos(myTagProperty->getDefaultStringValue(key), myTagProperty->getTagStr(), id, arrivalPos, arrivalPosProcedure, error);
633 // unset parameter
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
648 parseArrivalSpeed(myTagProperty->getDefaultStringValue(key), myTagProperty->getTagStr(), id, arrivalSpeed, arrivalSpeedProcedure, error);
649 // unset parameter
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
660 line = myTagProperty->getDefaultStringValue(key);
661 // unset parameter
663 }
664 break;
666 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
668 // mark parameter as set
670 } else {
671 // set default value
672 personNumber = myTagProperty->getDefaultIntValue(key);
673 // unset parameter
675 }
676 break;
678 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
680 // mark parameter as set
682 } else {
683 // set default value
684 containerNumber = myTagProperty->getDefaultIntValue(key);
685 // unset parameter
687 }
688 break;
690 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
691 // mark parameter as set
693 } else {
694 // unset parameter
696 }
697 break;
699 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
701 // mark parameter as set
703 } else {
704 // set default value
705 parseDepartPosLat(myTagProperty->getDefaultStringValue(key), myTagProperty->getTagStr(), id, departPosLat, departPosLatProcedure, error);
706 // unset parameter
708 }
709 break;
711 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
713 // mark parameter as set
715 } else {
716 // set default value
717 parseArrivalPosLat(myTagProperty->getDefaultStringValue(key), myTagProperty->getTagStr(), id, arrivalPosLat, arrivalPosLatProcedure, error);
718 // unset parameter
720 }
722 break;
725 break;
726 default:
728 break;
729 }
730}
731
732
733void
735 switch (key) {
736 case SUMO_ATTR_TYPE:
737 if (value) {
739 } else {
741 }
742 break;
744 if (value) {
746 } else {
748 }
749 break;
750 case SUMO_ATTR_SPEED:
751 if (value) {
753 } else {
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
Definition GUITextures.h:52
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TLF(string,...)
Definition MsgHandler.h:306
const std::string invalid_return< std::string >::value
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:58
#define TIME2STEPS(x)
Definition SUMOTime.h:60
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:49
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
void setAdditionalID(const std::string &newID)
set additional ID
friend class GNEAdditionalListed
declare friend class
void replaceDemandElementParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace demand element parent
GNEAdditional(GNENet *net, SumoXMLTag tag)
Constructor for templates.
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)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
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
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
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
void setParent(ParentType parent)
edit parent and childrens without maintain integrity (use carefully)
void setParents(const GNEHierarchicalContainerParents< ParentType > &parents)
set multiple parent element (ONLY use in constructors)
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 & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false)
writes a named attribute
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:200
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