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
22#include <netedit/GNENet.h>
24#include <netedit/GNEViewNet.h>
25#include <netedit/GNEUndoList.h>
32
33#include "GNECalibratorFlow.h"
34
35// ===========================================================================
36// member method definitions
37// ===========================================================================
38
40 GNEAdditional("", net, "", GNE_TAG_CALIBRATOR_FLOW, "") {
41 // set VPH and speed enabled
44 // reset ID
45 id.clear();
46}
47
48
50 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}
59
60
62 const SUMOVehicleParameter& vehicleParameters) :
63 GNEAdditional(calibratorParent, GNE_TAG_CALIBRATOR_FLOW, ""),
64 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
78void
81 // open tag
82 device.openTag(SUMO_TAG_FLOW);
83 // write vehicle attributes
85 // write end
87 // write route
89 // VPH
92 }
93 // write parameters
95 // close vehicle tag
96 device.closeTag();
97 } else {
98 WRITE_WARNING(TLF("calibratorFlow of calibrator '%' cannot be written. Either type or vehsPerHour or speed must be enabled", getParentAdditionals().front()->getID()));
99 }
100}
101
102
103bool
105 return true;
106}
107
108
109std::string
111 return "";
112}
113
114
115void
117 // nothing to fix
118}
119
120
121bool
123 return false;
124}
125
126
129 // calibrators flow cannot be moved
130 return nullptr;
131}
132
133
134void
136 // update centering boundary (needed for centering)
138}
139
140
143 // get rerouter parent position
144 Position signPosition = getParentAdditionals().front()->getPositionInView();
145 // set position depending of indexes
146 signPosition.add(4.5, (getDrawPositionIndex() * -1) + 1, 0);
147 // return signPosition
148 return signPosition;
149}
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
173 // push rotation matrix
175 // move to parent additional position
176 glTranslated(getParentAdditionals().front()->getPositionInView().x(), getParentAdditionals().front()->getPositionInView().y(), 0);
177 // rotate
178 glRotated((-1 * getParentAdditionals().front()->getAdditionalGeometry().getShapeRotations().front()) + 180, 0, 0, 1);
179 // draw rerouter interval as listed attribute
181 // pop rotation matrix
183 }
184}
185
186
187std::string
189 switch (key) {
190 case SUMO_ATTR_ID:
191 return getMicrosimID();
192 case SUMO_ATTR_TYPE:
193 return vtypeid;
194 case SUMO_ATTR_ROUTE:
195 return getParentDemandElements().at(1)->getID();
198 return toString(3600 / STEPS2TIME(repetitionOffset));
199 } else {
200 return "";
201 }
202 case SUMO_ATTR_SPEED:
205 } else {
206 return "";
207 }
208 case SUMO_ATTR_COLOR:
210 return toString(color);
211 } else {
213 }
214 case SUMO_ATTR_BEGIN:
215 return time2string(depart);
216 case SUMO_ATTR_END:
220 return getDepartLane();
221 } else {
223 }
226 return getDepartPos();
227 } else {
229 }
232 return getDepartSpeed();
233 } else {
235 }
238 return getArrivalLane();
239 } else {
241 }
244 return getArrivalPos();
245 } else {
247 }
250 return getArrivalSpeed();
251 } else {
253 }
254 case SUMO_ATTR_LINE:
256 return line;
257 } else {
259 }
262 return toString(personNumber);
263 } else {
265 }
269 } else {
271 }
274 return "true";
275 } else {
276 return "false";
277 }
280 return getDepartPosLat();
281 } else {
283 }
286 return getArrivalPosLat();
287 } else {
289 }
291 return getInsertionChecks();
292 case GNE_ATTR_PARENT:
293 return getParentAdditionals().at(0)->getID();
294 default:
295 return getCommonAttribute(this, key);
296 }
297}
298
299
300double
302 switch (key) {
303 case SUMO_ATTR_DEPART:
304 case SUMO_ATTR_BEGIN:
305 case SUMO_ATTR_END:
306 return STEPS2TIME(depart);
308 // only return departPos it if is given
310 return departPos;
311 } else {
312 return 0;
313 }
315 // only return departPos it if is given
317 return arrivalPos;
318 } else {
319 return -1;
320 }
321 case SUMO_ATTR_WIDTH:
322 case SUMO_ATTR_LENGTH:
323 case SUMO_ATTR_MINGAP:
324 return getParentDemandElements().at(0)->getAttributeDouble(key);
325 default:
326 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
327 }
328}
329
330
335
336
337void
338GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
339 if (value == getAttribute(key)) {
340 return; //avoid needless changes, later logic relies on the fact that attributes have changed
341 }
342 switch (key) {
343 case SUMO_ATTR_ID:
344 case SUMO_ATTR_TYPE:
345 case SUMO_ATTR_ROUTE:
346 case SUMO_ATTR_COLOR:
348 case SUMO_ATTR_SPEED:
349 case SUMO_ATTR_BEGIN:
350 case SUMO_ATTR_END:
357 case SUMO_ATTR_LINE:
364 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
365 break;
366 default:
367 setCommonAttribute(key, value, undoList);
368 break;
369 }
370}
371
372
373bool
374GNECalibratorFlow::isValid(SumoXMLAttr key, const std::string& value) {
375 switch (key) {
376 case SUMO_ATTR_ID:
377 return isValidAdditionalID(value);
378 case SUMO_ATTR_TYPE:
379 return (myNet->getAttributeCarriers()->retrieveDemandElements(NamespaceIDs::types, value, false) == nullptr);
380 case SUMO_ATTR_ROUTE:
381 return (myNet->getAttributeCarriers()->retrieveDemandElements(NamespaceIDs::routes, value, false) == nullptr);
383 if (value.empty()) {
384 // speed and vehsPerHour cannot be empty at the same time
386 return false;
387 } else {
388 return true;
389 }
390 } else if (canParse<double>(value)) {
391 const double dVal = parse<double>(value);
392 return (dVal >= 0 || dVal == -1);
393 } else {
394 return false;
395 }
396 case SUMO_ATTR_SPEED:
397 if (value.empty()) {
398 // speed and vehsPerHour cannot be empty at the same time
400 return false;
401 } else {
402 return true;
403 }
404 } else if (canParse<double>(value)) {
405 const double dVal = parse<double>(value);
406 return (dVal >= 0 || dVal == -1);
407 } else {
408 return false;
409 }
410 case SUMO_ATTR_COLOR:
411 return canParse<RGBColor>(value);
412 case SUMO_ATTR_BEGIN:
413 return canParse<SUMOTime>(value);
414 case SUMO_ATTR_END:
415 return canParse<SUMOTime>(value);
417 if ((value == "random") || (value == "free") || (value == "allowed") || (value == "best") || (value == "first")) {
418 return true;
419 } else {
420 return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
421 }
423 if ((value == "random") || (value == "free") || (value == "random_free") || (value == "base") || (value == "last")) {
424 return true;
425 } else {
426 return canParse<double>(value);
427 }
429 if ((value == "random") || (value == "max")) {
430 return true;
431 } else {
432 return canParse<double>(value);
433 }
435 if (value == "current") {
436 return true;
437 } else {
438 return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
439 }
441 if ((value == "random") || (value == "max")) {
442 return true;
443 } else {
444 return canParse<double>(value);
445 }
447 if (value == "current") {
448 return true;
449 } else {
450 return canParse<double>(value);
451 }
452 case SUMO_ATTR_LINE:
453 return true;
455 return canParse<int>(value) && parse<int>(value) >= 0;
457 return canParse<int>(value) && parse<int>(value) >= 0;
459 return canParse<bool>(value);
461 if ((value == "random") || (value == "free") || (value == "random_free") || (value == "left") || (value == "right") || (value == "center")) {
462 return true;
463 } else {
464 return canParse<double>(value);
465 }
467 if ((value == "left") || (value == "right") || (value == "center")) {
468 return true;
469 } else {
470 return canParse<double>(value);
471 }
473 return areInsertionChecksValid(value);
474 default:
475 return isCommonValid(key, value);
476 }
477}
478
479
480bool
482 switch (key) {
483 case SUMO_ATTR_TYPE:
484 return (parametersSet & VEHPARS_VTYPE_SET) != 0;
486 return (parametersSet & VEHPARS_VPH_SET) != 0;
487 case SUMO_ATTR_SPEED:
489 default:
490 return true;
491 }
492}
493
494
495std::string
497 return getTagStr();
498}
499
500
501std::string
505
506// ===========================================================================
507// private
508// ===========================================================================
509
510void
511GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value) {
512 // declare string error
513 std::string error;
514 switch (key) {
515 case SUMO_ATTR_ID:
516 // update microsimID
517 setAdditionalID(value);
518 break;
519 case SUMO_ATTR_TYPE:
520 if (!isTemplate()) {
521 if (value.empty()) {
523 } else {
525 }
526 }
527 // set manually vtypeID (needed for saving)
528 vtypeid = value;
529 break;
530 case SUMO_ATTR_ROUTE:
532 break;
534 if (value.empty()) {
535 parametersSet &= ~VEHPARS_VPH_SET;
536 } else {
537 repetitionOffset = TIME2STEPS(3600 / parse<double>(value));
538 // set parameters
540 }
541 break;
542 case SUMO_ATTR_SPEED:
543 if (value.empty()) {
544 parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET;
545 } else {
546 calibratorSpeed = parse<double>(value);
547 // mark parameter as set
549 }
550 break;
551 case SUMO_ATTR_COLOR:
552 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
553 color = parse<RGBColor>(value);
554 // mark parameter as set
556 } else {
557 // set default value
559 // unset parameter
560 parametersSet &= ~VEHPARS_COLOR_SET;
561 }
562 break;
563 case SUMO_ATTR_BEGIN:
564 depart = string2time(value);
565 break;
566 case SUMO_ATTR_END:
567 repetitionEnd = string2time(value);
568 break;
570 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
572 // mark parameter as set
574 } else {
575 // set default value
577 // unset parameter
578 parametersSet &= ~VEHPARS_DEPARTLANE_SET;
579 }
580 break;
582 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
584 // mark parameter as set
586 } else {
587 // set default value
589 // unset parameter
590 parametersSet &= ~VEHPARS_DEPARTPOS_SET;
591 }
592 // update geometry (except for template)
593 if (getParentAdditionals().size() > 0) {
595 }
596 break;
598 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
600 // mark parameter as set
602 } else {
603 // set default value
605 // unset parameter
606 parametersSet &= ~VEHPARS_DEPARTSPEED_SET;
607 }
608 break;
610 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
612 // mark parameter as set
614 } else {
615 // set default value
617 // unset parameter
618 parametersSet &= ~VEHPARS_ARRIVALLANE_SET;
619 }
620 break;
622 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
624 // mark parameter as set
626 } else {
627 // set default value
629 // unset parameter
630 parametersSet &= ~VEHPARS_ARRIVALPOS_SET;
631 }
632 // update geometry (except for template)
633 if (getParentAdditionals().size() > 0) {
635 }
636 break;
638 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
640 // mark parameter as set
642 } else {
643 // set default value
645 // unset parameter
646 parametersSet &= ~VEHPARS_ARRIVALSPEED_SET;
647 }
648 break;
649 case SUMO_ATTR_LINE:
650 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
651 line = value;
652 // mark parameter as set
654 } else {
655 // set default value
657 // unset parameter
658 parametersSet &= ~VEHPARS_LINE_SET;
659 }
660 break;
662 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
663 personNumber = parse<int>(value);
664 // mark parameter as set
666 } else {
667 // set default value
669 // unset parameter
670 parametersSet &= ~VEHPARS_PERSON_NUMBER_SET;
671 }
672 break;
674 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
675 containerNumber = parse<int>(value);
676 // mark parameter as set
678 } else {
679 // set default value
681 // unset parameter
682 parametersSet &= ~VEHPARS_CONTAINER_NUMBER_SET;
683 }
684 break;
686 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
687 // mark parameter as set
689 } else {
690 // unset parameter
691 parametersSet &= ~VEHPARS_ROUTE_SET;
692 }
693 break;
695 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
697 // mark parameter as set
699 } else {
700 // set default value
702 // unset parameter
703 parametersSet &= ~VEHPARS_DEPARTPOSLAT_SET;
704 }
705 break;
707 if (!value.empty() && (value != myTagProperty->getDefaultStringValue(key))) {
709 // mark parameter as set
711 } else {
712 // set default value
714 // unset parameter
715 parametersSet &= ~VEHPARS_ARRIVALPOSLAT_SET;
716 }
718 break;
721 break;
722 default:
723 setCommonAttribute(this, key, value);
724 break;
725 }
726}
727
728
729void
731 // nothing to do
732}
733
734void
735GNECalibratorFlow::commitMoveShape(const GNEMoveResult& /*moveResult*/, GNEUndoList* /*undoList*/) {
736 // nothing to do
737}
738
739
740void
742 switch (key) {
743 case SUMO_ATTR_TYPE:
744 if (value) {
746 } else {
747 parametersSet &= ~VEHPARS_VTYPE_SET;
748 }
749 break;
751 if (value) {
753 } else {
754 parametersSet &= ~VEHPARS_VPH_SET;
755 }
756 break;
757 case SUMO_ATTR_SPEED:
758 if (value) {
760 } else {
761 parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET;
762 }
763 break;
764 default:
765 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
766 }
767}
768
769/****************************************************************************/
@ VARIABLESPEEDSIGN_STEP
#define WRITE_WARNING(msg)
Definition MsgHandler.h:287
#define TLF(string,...)
Definition MsgHandler.h:307
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
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
void drawListedAdditional(const GUIVisualizationSettings &s, const Position &parentPosition, const double offsetX, const double extraOffsetY, const RGBColor baseCol, const RGBColor textCol, GUITexture texture, const std::string text) const
draw listed additional
void setAdditionalID(const std::string &newID)
set additional ID
int getDrawPositionIndex() const
get draw position index (used in rerouters and VSS)
const GUIGeometry & getAdditionalGeometry() const
obtain additional geometry
void replaceDemandElementParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace demand element parent
const std::string getID() const
get ID (all Attribute Carriers have one)
std::string getCommonAttribute(const Parameterised *parameterised, 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
GNENet * myNet
pointer to net
bool isCommonValid(SumoXMLAttr key, const std::string &value) const
const GNETagProperties * myTagProperty
reference to tagProperty associated with this attribute carrier
const Parameterised::Map & getACParametersMap() const
get parameters map
double getAttributeDouble(SumoXMLAttr key) const
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
GNECalibratorFlow(GNENet *net)
default constructor
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void toggleAttribute(SumoXMLAttr key, const bool value)
toggle attribute
~GNECalibratorFlow()
destructor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
GNEMoveOperation * getMoveOperation()
get move operation
void updateGeometry()
update pre-computed geometry information
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
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)
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
bool checkDrawMoveContour() const
check if draw move contour (red)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
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 getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
std::string getParentName() const
Returns the name of the parent object.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
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
move operation
move result
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
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2193
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 GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
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.
std::map< std::string, std::string > Map
parameters map
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
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
void add(const Position &pos)
Adds the given position to this one.
Definition Position.h:129
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.
bool showAdditionals() const
check if additionals has to be drawn
static const RGBColor calibratorColor
color for Calibrators