/
SUMOVehicleParameter.h
789 lines (646 loc) · 29.3 KB
/
SUMOVehicleParameter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
/****************************************************************************/
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others.
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0/
// This Source Code may also be made available under the following Secondary
// Licenses when the conditions for such availability set forth in the Eclipse
// Public License 2.0 are satisfied: GNU General Public License, version 2
// or later which is available at
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
/****************************************************************************/
/// @file SUMOVehicleParameter.h
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @author Axel Wegener
/// @author Michael Behrisch
/// @date 2006-01-24
///
// Structure representing possible vehicle parameter
/****************************************************************************/
#pragma once
#include <config.h>
#include <string>
#include <utils/common/Parameterised.h>
#include <utils/common/RGBColor.h>
#include <utils/common/SUMOTime.h>
#include <utils/common/SUMOVehicleClass.h>
// ===========================================================================
// class declarations
// ===========================================================================
class OutputDevice;
class OptionsCont;
// ===========================================================================
// value definitions
// ===========================================================================
const int VEHPARS_COLOR_SET = 1;
const int VEHPARS_VTYPE_SET = 2;
const int VEHPARS_DEPARTLANE_SET = 2 << 1;
const int VEHPARS_DEPARTPOS_SET = 2 << 2;
const int VEHPARS_DEPARTSPEED_SET = 2 << 3;
const int VEHPARS_END_SET = 2 << 4;
const int VEHPARS_NUMBER_SET = 2 << 5;
const int VEHPARS_PERIOD_SET = 2 << 6;
const int VEHPARS_VPH_SET = 2 << 7;
const int VEHPARS_PROB_SET = 2 << 8;
const int VEHPARS_ROUTE_SET = 2 << 9;
const int VEHPARS_ARRIVALLANE_SET = 2 << 10;
const int VEHPARS_ARRIVALPOS_SET = 2 << 11;
const int VEHPARS_ARRIVALSPEED_SET = 2 << 12;
const int VEHPARS_LINE_SET = 2 << 13;
const int VEHPARS_FROM_TAZ_SET = 2 << 14;
const int VEHPARS_TO_TAZ_SET = 2 << 15;
const int VEHPARS_FORCE_REROUTE = 2 << 16;
const int VEHPARS_PERSON_CAPACITY_SET = 2 << 17;
const int VEHPARS_PERSON_NUMBER_SET = 2 << 18;
const int VEHPARS_CONTAINER_NUMBER_SET = 2 << 19;
const int VEHPARS_DEPARTPOSLAT_SET = 2 << 20;
const int VEHPARS_ARRIVALPOSLAT_SET = 2 << 21;
const int VEHPARS_VIA_SET = 2 << 22;
const int VEHPARS_SPEEDFACTOR_SET = 2 << 23;
const int VEHPARS_DEPARTEDGE_SET = 2 << 24;
const int VEHPARS_ARRIVALEDGE_SET = 2 << 25;
const int VEHPARS_CALIBRATORSPEED_SET = 2 << 26;
const int VEHPARS_JUNCTIONMODEL_PARAMS_SET = 2 << 27;
const int STOP_INDEX_END = -1;
const int STOP_INDEX_FIT = -2;
const int STOP_START_SET = 1;
const int STOP_END_SET = 2;
const int STOP_DURATION_SET = 2 << 1;
const int STOP_UNTIL_SET = 2 << 2;
const int STOP_EXTENSION_SET = 2 << 3;
const int STOP_TRIGGER_SET = 2 << 4;
const int STOP_PARKING_SET = 2 << 5;
const int STOP_EXPECTED_SET = 2 << 6;
const int STOP_CONTAINER_TRIGGER_SET = 2 << 7;
const int STOP_EXPECTED_CONTAINERS_SET = 2 << 8;
const int STOP_TRIP_ID_SET = 2 << 9;
const int STOP_LINE_SET = 2 << 10;
const int STOP_SPEED_SET = 2 << 11;
const int STOP_SPLIT_SET = 2 << 12;
const int STOP_JOIN_SET = 2 << 13;
const int STOP_ARRIVAL_SET = 2 << 14;
const int STOP_PERMITTED_SET = 2 << 15;
const int STOP_ENDED_SET = 2 << 16;
const int STOP_STARTED_SET = 2 << 17;
const int STOP_POSLAT_SET = 2 << 18;
const double MIN_STOP_LENGTH = 2 * POSITION_EPS;
// ===========================================================================
// enum definitions
// ===========================================================================
/**
* @enum DepartDefinition
* @brief Possible ways to depart
*/
enum DepartDefinition {
/// @brief The time is given
DEPART_GIVEN,
/// @brief The departure is person triggered
DEPART_TRIGGERED,
/// @brief The departure is container triggered
DEPART_CONTAINER_TRIGGERED,
/// @brief The vehicle is discarded if emission fails (not fully implemented yet)
DEPART_NOW,
/// @brief The departure is triggered by a train split
DEPART_SPLIT,
/// @brief Tag for the last element in the enum for safe int casting
DEPART_DEF_MAX
};
/**
* @enum DepartLaneDefinition
* @brief Possible ways to choose a lane on depart
*/
enum class DepartLaneDefinition {
/// @brief No information given; use default
DEFAULT,
/// @brief The lane is given
GIVEN,
/// @brief The lane is chosen randomly
RANDOM,
/// @brief The least occupied lane is used
FREE,
/// @brief The least occupied lane from lanes which allow the continuation
ALLOWED_FREE,
/// @brief The least occupied lane from best lanes
BEST_FREE,
/// @brief The rightmost lane the vehicle may use
FIRST_ALLOWED
};
/**
* @enum DepartPosDefinition
* @brief Possible ways to choose the departure position
*/
enum class DepartPosDefinition {
/// @brief No information given; use default
DEFAULT,
/// @brief The position is given
GIVEN,
/// @brief The position is chosen randomly
RANDOM,
/// @brief A free position is chosen
FREE,
/// @brief Back-at-zero position
BASE,
/// @brief Insert behind the last vehicle as close as possible to still allow the specified departSpeed. Fallback to DepartPosDefinition::BASE if there is no vehicle on the departLane yet.
LAST,
/// @brief If a fixed number of random choices fails, a free position is chosen
RANDOM_FREE,
/// @brief depart position is endPos of first stop
STOP
};
/**
* @enum DepartPosLatDefinition
* @brief Possible ways to choose the lateral departure position
*/
enum class DepartPosLatDefinition {
/// @brief No information given; use default
DEFAULT,
/// @brief The position is given
GIVEN,
/// @brief At the rightmost side of the lane
RIGHT,
/// @brief At the center of the lane
CENTER,
/// @brief At the leftmost side of the lane
LEFT,
/// @brief The lateral position is chosen randomly
RANDOM,
/// @brief A free lateral position is chosen
FREE,
/// @brief If a fixed number of random choices fails, a free lateral position is chosen
RANDOM_FREE
};
/**
* @enum DepartSpeedDefinition
* @brief Possible ways to choose the departure speed
*/
enum class DepartSpeedDefinition {
/// @brief No information given; use default
DEFAULT,
/// @brief The speed is given
GIVEN,
/// @brief The speed is chosen randomly
RANDOM,
/// @brief The maximum safe speed is used
MAX,
/// @brief The maximum lane speed is used (speedLimit * speedFactor)
DESIRED,
/// @brief The maximum lane speed is used (speedLimit)
LIMIT,
/// @brief The speed of the last vehicle. Fallback to DepartSpeedDefinition::DESIRED if there is no vehicle on the departLane yet.
LAST,
/// @brief The average speed on the lane. Fallback to DepartSpeedDefinition::DESIRED if there is no vehicle on the departLane yet.
AVG
};
/**
* @enum RouteIndexDefinition
* @brief Possible ways to choose the departure and arrival edge
*/
enum class RouteIndexDefinition {
/// @brief No information given; use default
DEFAULT,
/// @brief The edge index is given
GIVEN,
/// @brief The edge is chosen randomly
RANDOM,
};
/**
* @enum ArrivalLaneDefinition
* @brief Possible ways to choose the arrival lane
*/
enum class ArrivalLaneDefinition {
/// @brief No information given; use default
DEFAULT = 0,
/// @brief The current lane shall be used
CURRENT = 1,
/// @brief The arrival lane is given
GIVEN = 2,
/// @brief The lane is chosen randomly
RANDOM = 3,
/// @brief The rightmost lane the vehicle may use
FIRST_ALLOWED = 4
};
/**
* @enum ArrivalPosDefinition
* @brief Possible ways to choose the arrival position
*/
enum class ArrivalPosDefinition {
/// @brief No information given; use default
DEFAULT,
/// @brief The arrival position is given
GIVEN,
/// @brief The arrival position is chosen randomly
RANDOM,
/// @brief Half the road length
CENTER,
/// @brief The maximum arrival position is used
MAX
};
/**
* @enum ArrivalPosLatDefinition
* @brief Possible ways to choose the lateral arrival position
*/
enum class ArrivalPosLatDefinition {
/// @brief No information given; use default
DEFAULT,
/// @brief The position is given
GIVEN,
/// @brief At the rightmost side of the lane
RIGHT,
/// @brief At the center of the lane
CENTER,
/// @brief At the leftmost side of the lane
LEFT
};
/**
* @enum ArrivalSpeedDefinition
* @brief Possible ways to choose the arrival speed
*/
enum class ArrivalSpeedDefinition {
/// @brief No information given; use default
DEFAULT,
/// @brief The speed is given
GIVEN,
/// @brief The current speed is used
CURRENT
};
// ===========================================================================
// struct definitions
// ===========================================================================
/**
* @class SUMOVehicleParameter
* @brief Structure representing possible vehicle parameter
*
* When used within a vehicle, parameter are usually const except for selected items
* adaptable via TraCI which are flagged as mutable below
* The fields yielding with "Procedure" describe whether the according value
* shall be used or another procedure is used to choose the value.
* @see DepartLaneDefinition
* @see DepartPosDefinition
* @see DepartSpeedDefinition
*/
class SUMOVehicleParameter : public Parameterised {
public:
/** @brief Constructor
*
* Initialises the structure with default values
*/
SUMOVehicleParameter();
/// @brief Destructor
virtual ~SUMOVehicleParameter();
/** @struct Stop
* @brief Definition of vehicle stop (position and duration)
*/
class Stop : public Parameterised {
public:
/// @brief Destructor
virtual ~Stop() {}
/** @brief Writes the stop as XML
*
* @param[in, out] dev The device to write into
* @exception IOError not yet implemented
*/
void write(OutputDevice& dev, const bool close = true, const bool writeTagAndParents = true) const;
/// @brief write trigger attribute
void writeTriggers(OutputDevice& dev) const;
/// @brief The edge to stop at (used only in NETEDIT)
std::string edge;
/// @brief The lane to stop at
std::string lane;
/// @brief (Optional) bus stop if one is assigned to the stop
std::string busstop;
/// @brief (Optional) container stop if one is assigned to the stop
std::string containerstop;
/// @brief (Optional) parking area if one is assigned to the stop
std::string parkingarea;
/// @brief (Optional) charging station if one is assigned to the stop
std::string chargingStation;
/// @brief (Optional) overhead line segment if one is assigned to the stop
std::string overheadWireSegment;
/// @brief The stopping position start
double startPos = 0.;
/// @brief The stopping position end
double endPos = 0.;
/// @brief The (expected) time at which the vehicle reaches the stop
SUMOTime arrival = -1;
/// @brief The stopping duration
SUMOTime duration = -1;
/// @brief The time at which the vehicle may continue its journey
SUMOTime until = -1;
/// @brief The maximum time extension for boarding / loading
SUMOTime extension = -1;
/// @brief whether an arriving person lets the vehicle continue
bool triggered = false;
/// @brief whether an arriving container lets the vehicle continue
bool containerTriggered = false;
/// @brief whether an joined vehicle lets this vehicle continue
bool joinTriggered = false;
/// @brief whether the vehicle is removed from the net while stopping
bool parking = false;
/// @brief IDs of persons the vehicle has to wait for until departing
std::set<std::string> awaitedPersons;
/// @brief IDs of persons or containers that may board/load at this stop
std::set<std::string> permitted;
/// @brief IDs of containers the vehicle has to wait for until departing
std::set<std::string> awaitedContainers;
/// @brief enable or disable friendly position (used by NETEDIT)
bool friendlyPos = false;
/// @brief act Type (only used by Persons) (used by NETEDIT)
std::string actType;
/// @brief id of the trip within a cyclical public transport route
std::string tripId;
/// @brief the new line id of the trip within a cyclical public transport route
std::string line;
/// @brief the id of the vehicle (train portion) that splits of upon reaching this stop
std::string split;
/// @brief the id of the vehicle (train portion) to which this vehicle shall be joined
std::string join;
/// @brief the speed at which this stop counts as reached (waypoint mode)
double speed = 0.;
/// @brief the time at which this stop was reached
mutable SUMOTime started = -1;
/// @brief the time at which this stop was ended
SUMOTime ended = -1;
/// @brief the lateral offset when stopping
double posLat = INVALID_DOUBLE;
/// @brief lanes and positions connected to this stop (only used by duarouter where Stop is used to store stopping places)
std::vector<std::tuple<std::string, double, double> > accessPos;
/// @brief at which position in the stops list
int index = 0;
/// @brief Information for the output which parameter were set
int parametersSet = 0;
};
/** @brief Returns whether the given parameter was set
* @param[in] what The parameter which one asks for
* @return Whether the given parameter was set
*/
bool wasSet(int what) const {
return (parametersSet & what) != 0;
}
/** @brief Writes the parameters as a beginning element
*
* @param[in, out] dev The device to write into
* @param[in] oc The options to get defaults from
* @param[in] altTag The "root" tag to write (defaults to vehicle)
* @param[in] typeID The typeID to write (defaults to member vtypeid)
* @exception IOError not yet implemented
*/
void write(OutputDevice& dev, const OptionsCont& oc, const SumoXMLTag altTag = SUMO_TAG_VEHICLE, const std::string& typeID = "") const;
/** @brief Returns whether the defaults shall be used
* @param[in] oc The options to get the options from
* @param[in] optionName The name of the option to determine whether its value shall be used
* @return Whether the option is set and --defaults-override was set
*/
bool defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const;
/// @name Depart/arrival-attributes verification
/// @{
/** @brief Validates a given depart value
* @param[in] val The depart value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] depart The parsed depart time, if given
* @param[out] dd The parsed departProcedure definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid depart definition
*/
static bool parseDepart(const std::string& val, const std::string& element, const std::string& id,
SUMOTime& depart, DepartDefinition& dd, std::string& error, const std::string& attr = "departure");
/** @brief Validates a given departLane value
* @param[in] val The departLane value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] lane The parsed lane, if given
* @param[out] dld The parsed departLane definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid departLane definition
*/
static bool parseDepartLane(const std::string& val, const std::string& element, const std::string& id,
int& lane, DepartLaneDefinition& dld, std::string& error);
/** @brief Validates a given departPos value
* @param[in] val The departPos value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] pos The parsed position, if given
* @param[out] dpd The parsed departPos definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid departPos definition
*/
static bool parseDepartPos(const std::string& val, const std::string& element, const std::string& id,
double& pos, DepartPosDefinition& dpd, std::string& error);
/** @brief Validates a given departPosLat value
* @param[in] val The departPosLat value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] pos The parsed position, if given
* @param[out] dpd The parsed departPosLat definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid departPosLat definition
*/
static bool parseDepartPosLat(const std::string& val, const std::string& element, const std::string& id,
double& pos, DepartPosLatDefinition& dpd, std::string& error);
/** @brief Validates a given departSpeed value
* @param[in] val The departSpeed value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] speed The parsed speed, if given
* @param[out] dsd The parsed departSpeed definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid departSpeed definition
*/
static bool parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,
double& speed, DepartSpeedDefinition& dsd, std::string& error);
/** @brief Validates a given departEdge or arrivalEdge value
* @param[in] val The departEdge value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] edgeIndex The parsed edge index, if given
* @param[out] ded The parsed departEdge definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid departEdge definition
*/
static bool parseRouteIndex(const std::string& val, const std::string& element, const std::string& id,
const SumoXMLAttr attr,
int& edgeIndex, RouteIndexDefinition& rid, std::string& error);
/** @brief Validates a given arrivalLane value
* @param[in] val The arrivalLane value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] lane The parsed lane, if given
* @param[out] ald The parsed arrivalLane definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid arrivalLane definition
*/
static bool parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,
int& lane, ArrivalLaneDefinition& ald, std::string& error);
/** @brief Validates a given arrivalPos value
* @param[in] val The arrivalPos value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] pos The parsed position, if given
* @param[out] apd The parsed arrivalPos definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid arrivalPos definition
*/
static bool parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,
double& pos, ArrivalPosDefinition& apd, std::string& error);
/** @brief Validates a given arrivalPosLat value
* @param[in] val The arrivalPosLat value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] pos The parsed position, if given
* @param[out] apd The parsed arrivalPosLat definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid arrivalPosLat definition
*/
static bool parseArrivalPosLat(const std::string& val, const std::string& element, const std::string& id,
double& pos, ArrivalPosLatDefinition& apd, std::string& error);
/** @brief Validates a given arrivalSpeed value
* @param[in] val The arrivalSpeed value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] speed The parsed speed, if given
* @param[out] asd The parsed arrivalSpeed definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid arrivalSpeed definition
*/
static bool parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id,
double& speed, ArrivalSpeedDefinition& asd, std::string& error);
/// @}
/** @brief Interprets negative edge positions and fits them onto a given edge
* @param[in] pos The position to be interpreted
* @param[in] maximumValue The maximum allowed value (edge length)
* @param[in] attr The attribute from which the value originated
* @param[in] id The id of the object to which this attribute belongs
* @return Whether the interpreted position
*/
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string& id, bool silent = false);
/** @brief Validates a given person modes value
* @param[in] modes The modes value to parse
* @param[in] element The name of the type of the parsed element, for building the error message
* @param[in] id The id of the parsed element, for building the error message
* @param[out] modeSet The parsed modes definition
* @param[out] error Error message, if an error occures
* @return Whether the given value is a valid arrivalSpeed definition
*/
static bool parsePersonModes(const std::string& modes, const std::string& element, const std::string& id, SVCPermissions& modeSet, std::string& error);
/// @brief parses stop trigger values
static void parseStopTriggers(const std::vector<std::string>& triggers, bool expectTrigger, Stop& stop);
/// @brief The vehicle tag
SumoXMLTag tag;
/// @brief The vehicle's id
std::string id;
/// @brief The vehicle's route id
std::string routeid;
/// @brief The vehicle's type id
std::string vtypeid;
/// @brief The vehicle's color, TraCI may change this
mutable RGBColor color;
/// @name Departure definition
/// @{
/// @brief The vehicle's departure time
SUMOTime depart;
/// @brief Information how the vehicle shall choose the depart time
DepartDefinition departProcedure;
/// @brief (optional) The lane the vehicle shall depart from (index in edge)
int departLane;
/// @brief Information how the vehicle shall choose the lane to depart from
DepartLaneDefinition departLaneProcedure;
/// @brief (optional) The position the vehicle shall depart from
double departPos;
/// @brief Information how the vehicle shall choose the departure position
DepartPosDefinition departPosProcedure;
/// @brief (optional) The lateral position the vehicle shall depart from
double departPosLat;
/// @brief Information how the vehicle shall choose the lateral departure position
DepartPosLatDefinition departPosLatProcedure;
/// @brief (optional) The initial speed of the vehicle
double departSpeed;
/// @brief Information how the vehicle's initial speed shall be chosen
DepartSpeedDefinition departSpeedProcedure;
/// @brief (optional) The initial edge within the route of the vehicle
int departEdge;
/// @brief Information how the vehicle's initial edge shall be chosen
RouteIndexDefinition departEdgeProcedure;
/// @}
/// @name Arrival definition
/// @{
/// @brief (optional) The lane the vehicle shall arrive on (not used yet)
int arrivalLane;
/// @brief Information how the vehicle shall choose the lane to arrive on
ArrivalLaneDefinition arrivalLaneProcedure;
/// @brief (optional) The position the vehicle shall arrive on
double arrivalPos;
/// @brief Information how the vehicle shall choose the arrival position
ArrivalPosDefinition arrivalPosProcedure;
/// @brief (optional) The lateral position the vehicle shall arrive on
double arrivalPosLat;
/// @brief Information how the vehicle shall choose the lateral arrival position
ArrivalPosLatDefinition arrivalPosLatProcedure;
/// @brief (optional) The final speed of the vehicle (not used yet)
double arrivalSpeed;
/// @brief Information how the vehicle's end speed shall be chosen
ArrivalSpeedDefinition arrivalSpeedProcedure;
/// @brief (optional) The final edge within the route of the vehicle
int arrivalEdge;
/// @brief Information how the vehicle's final edge shall be chosen
RouteIndexDefinition arrivalEdgeProcedure;
/// @}
/// @name Repetition definition
/// @{
/// @brief The number of times the vehicle shall be repeatedly inserted
int repetitionNumber;
/// @brief The number of times the vehicle was already inserted
int repetitionsDone;
/// @brief The time offset between vehicle reinsertions
SUMOTime repetitionOffset;
/// @brief The probability for emitting a vehicle per second
double repetitionProbability;
/// @brief The time at which the flow ends (only needed when using repetitionProbability)
SUMOTime repetitionEnd;
/// @}
/// @brief The vehicle's line (mainly for public transport)
mutable std::string line;
/// @brief The vehicle's origin zone (district)
std::string fromTaz;
/// @brief The vehicle's destination zone (district)
std::string toTaz;
/// @brief List of the stops the vehicle will make, TraCI may add entries here
mutable std::vector<Stop> stops;
/// @brief List of the via-edges the vehicle must visit
mutable std::vector<std::string> via;
/// @brief The static number of persons in the vehicle when it departs (not including boarding persons)
int personNumber;
/// @brief The static number of containers in the vehicle when it departs
int containerNumber;
/// @brief individual speedFactor (overriding distribution from vType)
double speedFactor;
/// @brief speed (used by calibrator flows
double calibratorSpeed;
/// @brief Information for the router which parameter were set, TraCI may modify this (when changing color)
mutable int parametersSet;
protected:
/// @brief obtain depart parameter in string format
std::string getDepart() const;
/// @brief obtain depart lane parameter in string format
std::string getDepartLane() const;
/// @brief obtain depart pos parameter in string format
std::string getDepartPos() const;
/// @brief obtain depart pos lat parameter in string format
std::string getDepartPosLat() const;
/// @brief obtain depart speed parameter in string format
std::string getDepartSpeed() const;
/// @brief obtain depart edge parameter in string format
std::string getDepartEdge() const;
/// @brief obtain arrival lane parameter in string format
std::string getArrivalLane() const;
/// @brief obtain arrival pos parameter in string format
std::string getArrivalPos() const;
/// @brief obtain arrival pos lat parameter in string format
std::string getArrivalPosLat() const;
/// @brief obtain arrival speed parameter in string format
std::string getArrivalSpeed() const;
/// @brief obtain arrival edge parameter in string format
std::string getArrivalEdge() const;
};