Eclipse SUMO - Simulation of Urban MObility
TraCIDefs.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2012-2022 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/****************************************************************************/
21// C++ TraCI client API implementation
22/****************************************************************************/
23#pragma once
24// we do not include config.h here, since we should be independent of a special sumo build
25// but we want to avoid certain warnings in MSVC see config.h.cmake for details
26#ifdef _MSC_VER
27#pragma warning(push)
28#pragma warning(disable: 4514 4820)
29#endif
30
32#include <vector>
33#include <limits>
34#include <map>
35#include <string>
36#include <stdexcept>
37#include <sstream>
38#include <memory>
39#include <cstring>
40
41
42// ===========================================================================
43// common declarations
44// ===========================================================================
45namespace libsumo {
46class VariableWrapper;
47}
48namespace tcpip {
49class Storage;
50}
51
52
53// ===========================================================================
54// global definitions
55// ===========================================================================
56#ifdef LIBTRACI
57#define LIBSUMO_NAMESPACE libtraci
58#else
59#define LIBSUMO_NAMESPACE libsumo
60#endif
61
62#define LIBSUMO_SUBSCRIPTION_API \
63static void subscribe(const std::string& objectID, const std::vector<int>& varIDs = std::vector<int>({-1}), \
64 double begin = libsumo::INVALID_DOUBLE_VALUE, double end = libsumo::INVALID_DOUBLE_VALUE, const libsumo::TraCIResults& params = libsumo::TraCIResults()); \
65static void unsubscribe(const std::string& objectID); \
66static void subscribeContext(const std::string& objectID, int domain, double dist, const std::vector<int>& varIDs = std::vector<int>({-1}), \
67 double begin = libsumo::INVALID_DOUBLE_VALUE, double end = libsumo::INVALID_DOUBLE_VALUE, const libsumo::TraCIResults& params = libsumo::TraCIResults()); \
68static void unsubscribeContext(const std::string& objectID, int domain, double dist); \
69static const libsumo::SubscriptionResults getAllSubscriptionResults(); \
70static const libsumo::TraCIResults getSubscriptionResults(const std::string& objectID); \
71static const libsumo::ContextSubscriptionResults getAllContextSubscriptionResults(); \
72static const libsumo::SubscriptionResults getContextSubscriptionResults(const std::string& objectID); \
73static void subscribeParameterWithKey(const std::string& objectID, const std::string& key, double beginTime = libsumo::INVALID_DOUBLE_VALUE, double endTime = libsumo::INVALID_DOUBLE_VALUE); \
74static const int DOMAIN_ID;
75
76#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM) \
77const int CLASS::DOMAIN_ID(libsumo::CMD_GET_##DOM##_VARIABLE); \
78void \
79CLASS::subscribe(const std::string& objectID, const std::vector<int>& varIDs, double begin, double end, const libsumo::TraCIResults& params) { \
80 libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOM##_VARIABLE, objectID, varIDs, begin, end, params); \
81} \
82void \
83CLASS::unsubscribe(const std::string& objectID) { \
84 libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOM##_VARIABLE, objectID, std::vector<int>(), libsumo::INVALID_DOUBLE_VALUE, libsumo::INVALID_DOUBLE_VALUE, libsumo::TraCIResults()); \
85} \
86void \
87CLASS::subscribeContext(const std::string& objectID, int domain, double dist, const std::vector<int>& varIDs, double begin, double end, const TraCIResults& params) { \
88 libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOM##_CONTEXT, objectID, varIDs, begin, end, params, domain, dist); \
89} \
90void \
91CLASS::unsubscribeContext(const std::string& objectID, int domain, double dist) { \
92 libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOM##_CONTEXT, objectID, std::vector<int>(), libsumo::INVALID_DOUBLE_VALUE, libsumo::INVALID_DOUBLE_VALUE, libsumo::TraCIResults(), domain, dist); \
93} \
94const libsumo::SubscriptionResults \
95CLASS::getAllSubscriptionResults() { \
96 return mySubscriptionResults; \
97} \
98const libsumo::TraCIResults \
99CLASS::getSubscriptionResults(const std::string& objectID) { \
100 return mySubscriptionResults[objectID]; \
101} \
102const libsumo::ContextSubscriptionResults \
103CLASS::getAllContextSubscriptionResults() { \
104 return myContextSubscriptionResults; \
105} \
106const libsumo::SubscriptionResults \
107CLASS::getContextSubscriptionResults(const std::string& objectID) { \
108 return myContextSubscriptionResults[objectID]; \
109} \
110void \
111CLASS::subscribeParameterWithKey(const std::string& objectID, const std::string& key, double beginTime, double endTime) { \
112 libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOM##_VARIABLE, objectID, std::vector<int>({libsumo::VAR_PARAMETER_WITH_KEY}), beginTime, endTime, libsumo::TraCIResults {{libsumo::VAR_PARAMETER_WITH_KEY, std::make_shared<libsumo::TraCIString>(key)}}); \
113}
114
115
116#define LIBSUMO_ID_PARAMETER_API \
117static std::vector<std::string> getIDList(); \
118static int getIDCount(); \
119static std::string getParameter(const std::string& objectID, const std::string& param); \
120static const std::pair<std::string, std::string> getParameterWithKey(const std::string& objectID, const std::string& key); \
121static void setParameter(const std::string& objectID, const std::string& param, const std::string& value);
122
123#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS) \
124const std::pair<std::string, std::string> \
125CLASS::getParameterWithKey(const std::string& objectID, const std::string& key) { \
126 return std::make_pair(key, getParameter(objectID, key)); \
127}
128
129
130// ===========================================================================
131// class and type definitions
132// ===========================================================================
133namespace libsumo {
138class TraCIException : public std::runtime_error {
139public:
141 TraCIException(std::string what)
142 : std::runtime_error(what) {}
143};
144
149class FatalTraCIError : public std::runtime_error {
150public:
152 FatalTraCIError(std::string what)
153 : std::runtime_error(what) {}
154};
155
158
160 virtual ~TraCIResult() {}
161 virtual std::string getString() const {
162 return "";
163 }
164 virtual int getType() const {
165 return -1;
166 }
167};
168
173 std::string getString() const {
174 std::ostringstream os;
175 os << "TraCIPosition(" << x << "," << y << "," << z << ")";
176 return os.str();
177 }
179};
180
186 TraCIRoadPosition(const std::string e, const double p) : edgeID(e), pos(p) {}
187 std::string getString() const {
188 std::ostringstream os;
189 os << "TraCIRoadPosition(" << edgeID << "_" << laneIndex << "," << pos << ")";
190 return os.str();
191 }
192 std::string edgeID = "";
195};
196
201 TraCIColor() : r(0), g(0), b(0), a(255) {}
202 TraCIColor(int r, int g, int b, int a = 255) : r(r), g(g), b(b), a(a) {}
203 std::string getString() const {
204 std::ostringstream os;
205 os << "TraCIColor(" << r << "," << g << "," << b << "," << a << ")";
206 return os.str();
207 }
208 int r, g, b, a;
209};
210
211
216 std::string getString() const {
217 std::ostringstream os;
218 os << "[";
219 for (const TraCIPosition& v : value) {
220 os << "(" << v.x << "," << v.y << "," << v.z << ")";
221 }
222 os << "]";
223 return os.str();
224 }
225 std::vector<TraCIPosition> value;
226};
227
228
230 TraCIInt() : value(0) {}
231 TraCIInt(int v) : value(v) {}
232 std::string getString() const {
233 std::ostringstream os;
234 os << value;
235 return os.str();
236 }
237 int value;
238};
239
240
243 TraCIDouble(double v) : value(v) {}
244 std::string getString() const {
245 std::ostringstream os;
246 os << value;
247 return os.str();
248 }
249 int getType() const {
251 }
252 double value;
253};
254
255
258 TraCIString(std::string v) : value(v) {}
259 std::string getString() const {
260 return value;
261 }
262 int getType() const {
264 }
265 std::string value;
266};
267
268
270 std::string getString() const {
271 std::ostringstream os;
272 os << "[";
273 for (std::string v : value) {
274 os << v << ",";
275 }
276 os << "]";
277 return os.str();
278 }
279 std::vector<std::string> value;
280};
281
282
284 std::string getString() const {
285 std::ostringstream os;
286 os << "[";
287 for (double v : value) {
288 os << v << ",";
289 }
290 os << "]";
291 return os.str();
292 }
293 std::vector<double> value;
294};
295
296
298typedef std::map<int, std::shared_ptr<libsumo::TraCIResult> > TraCIResults;
300typedef std::map<std::string, libsumo::TraCIResults> SubscriptionResults;
301typedef std::map<std::string, libsumo::SubscriptionResults> ContextSubscriptionResults;
302
303
305public:
307 TraCIPhase(const double _duration, const std::string& _state, const double _minDur = libsumo::INVALID_DOUBLE_VALUE,
308 const double _maxDur = libsumo::INVALID_DOUBLE_VALUE,
309 const std::vector<int>& _next = std::vector<int>(),
310 const std::string& _name = "") :
311 duration(_duration), state(_state), minDur(_minDur), maxDur(_maxDur), next(_next), name(_name) {}
313
314 double duration;
315 std::string state;
316 double minDur, maxDur;
317 std::vector<int> next;
318 std::string name;
319};
320}
321
322
323#ifdef SWIG
324%template(TraCIPhaseVector) std::vector<std::shared_ptr<libsumo::TraCIPhase> >; // *NOPAD*
325#endif
326
327
328namespace libsumo {
330public:
332 TraCILogic(const std::string& _programID, const int _type, const int _currentPhaseIndex,
333 const std::vector<std::shared_ptr<libsumo::TraCIPhase> >& _phases = std::vector<std::shared_ptr<libsumo::TraCIPhase> >())
334 : programID(_programID), type(_type), currentPhaseIndex(_currentPhaseIndex), phases(_phases) {}
336
337 std::string programID;
338 int type;
340 std::vector<std::shared_ptr<libsumo::TraCIPhase> > phases;
341 std::map<std::string, std::string> subParameter;
342};
343
344
346public:
348 TraCILink(const std::string& _from, const std::string& _via, const std::string& _to)
349 : fromLane(_from), viaLane(_via), toLane(_to) {}
351
352 std::string fromLane;
353 std::string viaLane;
354 std::string toLane;
355};
356
357
359public:
360 TraCIConnection() {} // this is needed by SWIG when building a vector of this type, please don't use it
361 TraCIConnection(const std::string& _approachedLane, const bool _hasPrio, const bool _isOpen, const bool _hasFoe,
362 const std::string _approachedInternal, const std::string _state, const std::string _direction, const double _length)
363 : approachedLane(_approachedLane), hasPrio(_hasPrio), isOpen(_isOpen), hasFoe(_hasFoe),
364 approachedInternal(_approachedInternal), state(_state), direction(_direction), length(_length) {}
366
367 std::string approachedLane;
369 bool isOpen;
370 bool hasFoe;
372 std::string state;
373 std::string direction;
374 double length;
375};
376
377
381 std::string id;
383 double length;
385 double entryTime;
387 double leaveTime;
389 std::string typeID;
390};
391
392
395 std::string id;
399 double dist;
401 char state;
402};
403
404
406
407 TraCINextStopData(const std::string& lane = "",
408 double startPos = INVALID_DOUBLE_VALUE,
409 double endPos = INVALID_DOUBLE_VALUE,
410 const std::string& stoppingPlaceID = "",
411 int stopFlags = 0,
412 double duration = INVALID_DOUBLE_VALUE,
413 double until = INVALID_DOUBLE_VALUE,
414 double intendedArrival = INVALID_DOUBLE_VALUE,
415 double arrival = INVALID_DOUBLE_VALUE,
416 double depart = INVALID_DOUBLE_VALUE,
417 const std::string& split = "",
418 const std::string& join = "",
419 const std::string& actType = "",
420 const std::string& tripId = "",
421 const std::string& line = "",
422 double speed = 0):
423 lane(lane),
424 startPos(startPos),
425 endPos(endPos),
426 stoppingPlaceID(stoppingPlaceID),
427 stopFlags(stopFlags),
428 duration(duration),
429 until(until),
430 intendedArrival(intendedArrival),
431 arrival(arrival),
432 depart(depart),
433 split(split),
434 join(join),
435 actType(actType),
436 tripId(tripId),
437 line(line),
438 speed(speed)
439 {}
440
441 std::string getString() const {
442 std::ostringstream os;
443 os << "TraCINextStopData(" << lane << "," << endPos << "," << stoppingPlaceID
444 << "," << stopFlags << "," << duration << "," << until
445 << "," << arrival << ")";
446 return os.str();
447 }
448
450 std::string lane;
452 double startPos;
454 double endPos;
456 std::string stoppingPlaceID;
460 double duration;
462 double until;
466 double arrival;
468 double depart;
470 std::string split;
472 std::string join;
474 std::string actType;
476 std::string tripId;
478 std::string line;
480 double speed;
481};
482
483
489 std::string getString() const {
490 std::ostringstream os;
491 os << "TraCINextStopDataVector[";
492 for (TraCINextStopData v : value) {
493 os << v.getString() << ",";
494 }
495 os << "]";
496 return os.str();
497 }
498
499 std::vector<TraCINextStopData> value;
500};
501
502
505 std::string laneID;
507 double length;
515 std::vector<std::string> continuationLanes;
516};
517
518
520public:
521 TraCIStage(int type = INVALID_INT_VALUE, const std::string& vType = "", const std::string& line = "", const std::string& destStop = "",
522 const std::vector<std::string>& edges = std::vector<std::string>(),
523 double travelTime = INVALID_DOUBLE_VALUE, double cost = INVALID_DOUBLE_VALUE, double length = INVALID_DOUBLE_VALUE,
524 const std::string& intended = "", double depart = INVALID_DOUBLE_VALUE, double departPos = INVALID_DOUBLE_VALUE,
525 double arrivalPos = INVALID_DOUBLE_VALUE, const std::string& description = "") :
526 type(type), vType(vType), line(line), destStop(destStop), edges(edges), travelTime(travelTime), cost(cost),
527 length(length), intended(intended), depart(depart), departPos(departPos), arrivalPos(arrivalPos), description(description) {}
529 int type;
531 std::string vType;
533 std::string line;
535 std::string destStop;
537 std::vector<std::string> edges;
541 double cost;
543 double length;
545 std::string intended;
547 double depart;
549 double departPos;
553 std::string description;
554};
555
556
557
559public:
561 TraCIReservation(const std::string& id,
562 const std::vector<std::string>& persons,
563 const std::string& group,
564 const std::string& fromEdge,
565 const std::string& toEdge,
566 double departPos,
567 double arrivalPos,
568 double depart,
569 double reservationTime,
570 int state) :
571 id(id), persons(persons), group(group), fromEdge(fromEdge), toEdge(toEdge), departPos(departPos), arrivalPos(arrivalPos),
572 depart(depart), reservationTime(reservationTime), state(state) {}
574 std::string id;
576 std::vector<std::string> persons;
578 std::string group;
580 std::string fromEdge;
582 std::string toEdge;
584 double departPos;
588 double depart;
592 int state;
593};
594
597 std::string collider;
598 std::string victim;
599 std::string colliderType;
600 std::string victimType;
604 std::string type;
606 std::string lane;
608 double pos;
609};
610
611
614 std::string signalId;
616 std::string tripId;
618 std::string foeId;
620 std::string foeSignal;
622 int limit;
624 int type;
628 bool active;
630 std::map<std::string, std::string> param;
631
632 std::string getString() const {
633 std::ostringstream os;
634 os << "TraCISignalConstraint(signalId=" << signalId << ", tripid=" << tripId << ", foeSignal=" << foeSignal << ", foeId=" << foeId << ")";
635 return os.str();
636 }
637};
638
639}
640
641// pop MSVC warnings
642#ifdef _MSC_VER
643#pragma warning(pop)
644#endif
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
An error which is not recoverable.
Definition: TraCIDefs.h:149
FatalTraCIError(std::string what)
Definition: TraCIDefs.h:152
TraCIConnection(const std::string &_approachedLane, const bool _hasPrio, const bool _isOpen, const bool _hasFoe, const std::string _approachedInternal, const std::string _state, const std::string _direction, const double _length)
Definition: TraCIDefs.h:361
std::string approachedLane
Definition: TraCIDefs.h:367
std::string approachedInternal
Definition: TraCIDefs.h:371
An error which allows to continue.
Definition: TraCIDefs.h:138
TraCIException(std::string what)
Definition: TraCIDefs.h:141
std::map< std::string, std::string > subParameter
Definition: TraCIDefs.h:341
std::string programID
Definition: TraCIDefs.h:337
std::vector< std::shared_ptr< libsumo::TraCIPhase > > phases
Definition: TraCIDefs.h:340
TraCILogic(const std::string &_programID, const int _type, const int _currentPhaseIndex, const std::vector< std::shared_ptr< libsumo::TraCIPhase > > &_phases=std::vector< std::shared_ptr< libsumo::TraCIPhase > >())
Definition: TraCIDefs.h:332
std::vector< int > next
Definition: TraCIDefs.h:317
std::string state
Definition: TraCIDefs.h:315
std::string name
Definition: TraCIDefs.h:318
TraCIPhase(const double _duration, const std::string &_state, const double _minDur=libsumo::INVALID_DOUBLE_VALUE, const double _maxDur=libsumo::INVALID_DOUBLE_VALUE, const std::vector< int > &_next=std::vector< int >(), const std::string &_name="")
Definition: TraCIDefs.h:307
double depart
pickup-time
Definition: TraCIDefs.h:588
double departPos
pickup position on the origin edge
Definition: TraCIDefs.h:584
double reservationTime
time when the reservation was made
Definition: TraCIDefs.h:590
double arrivalPos
drop-off position on the destination edge
Definition: TraCIDefs.h:586
std::vector< std::string > persons
The persons ids that are part of this reservation.
Definition: TraCIDefs.h:576
int state
the state of this reservation
Definition: TraCIDefs.h:592
std::string fromEdge
The origin edge id.
Definition: TraCIDefs.h:580
std::string group
The group id of this reservation.
Definition: TraCIDefs.h:578
std::string id
The id of the taxi reservation (usable for traci.vehicle.dispatchTaxi)
Definition: TraCIDefs.h:574
std::string toEdge
The destination edge id.
Definition: TraCIDefs.h:582
TraCIReservation(const std::string &id, const std::vector< std::string > &persons, const std::string &group, const std::string &fromEdge, const std::string &toEdge, double departPos, double arrivalPos, double depart, double reservationTime, int state)
Definition: TraCIDefs.h:561
std::string intended
id of the intended vehicle for public transport ride
Definition: TraCIDefs.h:545
int type
The type of stage (walking, driving, ...)
Definition: TraCIDefs.h:529
std::string destStop
The id of the destination stop.
Definition: TraCIDefs.h:535
double length
length in m
Definition: TraCIDefs.h:543
double travelTime
duration of the stage in seconds
Definition: TraCIDefs.h:539
double departPos
position on the lane when starting the stage
Definition: TraCIDefs.h:549
std::string description
arbitrary description string
Definition: TraCIDefs.h:553
std::string line
The line or the id of the vehicle type.
Definition: TraCIDefs.h:533
double cost
effort needed
Definition: TraCIDefs.h:541
TraCIStage(int type=INVALID_INT_VALUE, const std::string &vType="", const std::string &line="", const std::string &destStop="", const std::vector< std::string > &edges=std::vector< std::string >(), double travelTime=INVALID_DOUBLE_VALUE, double cost=INVALID_DOUBLE_VALUE, double length=INVALID_DOUBLE_VALUE, const std::string &intended="", double depart=INVALID_DOUBLE_VALUE, double departPos=INVALID_DOUBLE_VALUE, double arrivalPos=INVALID_DOUBLE_VALUE, const std::string &description="")
Definition: TraCIDefs.h:521
double depart
intended depart time for public transport ride or INVALID_DOUBLE_VALUE
Definition: TraCIDefs.h:547
std::vector< std::string > edges
The sequence of edges to travel.
Definition: TraCIDefs.h:537
double arrivalPos
position on the lane when ending the stage
Definition: TraCIDefs.h:551
std::string vType
The vehicle type when using a private car or bike.
Definition: TraCIDefs.h:531
TRACI_CONST double INVALID_DOUBLE_VALUE
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:301
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:300
TRACI_CONST int INVALID_INT_VALUE
TRACI_CONST int TYPE_DOUBLE
std::map< int, std::shared_ptr< libsumo::TraCIResult > > TraCIResults
{variable->value}
Definition: TraCIDefs.h:298
TRACI_CONST int TYPE_STRING
Definition: json.hpp:4471
Definition: socket.cpp:62
double length
The length than can be driven from that lane without lane change.
Definition: TraCIDefs.h:507
double occupation
The traffic density along length.
Definition: TraCIDefs.h:509
bool allowsContinuation
Whether this lane allows continuing the route.
Definition: TraCIDefs.h:513
int bestLaneOffset
The offset of this lane from the best lane.
Definition: TraCIDefs.h:511
std::vector< std::string > continuationLanes
The sequence of lanes that best allows continuing the route without lane change.
Definition: TraCIDefs.h:515
std::string laneID
The id of the lane.
Definition: TraCIDefs.h:505
std::string lane
The lane where the collision happended.
Definition: TraCIDefs.h:606
std::string type
The type of collision.
Definition: TraCIDefs.h:604
std::string collider
The ids of the participating vehicles and persons.
Definition: TraCIDefs.h:597
std::string victimType
Definition: TraCIDefs.h:600
double pos
The position of the collision along the lane.
Definition: TraCIDefs.h:608
std::string colliderType
Definition: TraCIDefs.h:599
std::string getString() const
Definition: TraCIDefs.h:203
TraCIColor(int r, int g, int b, int a=255)
Definition: TraCIDefs.h:202
int getType() const
Definition: TraCIDefs.h:249
TraCIDouble(double v)
Definition: TraCIDefs.h:243
std::string getString() const
Definition: TraCIDefs.h:244
std::vector< double > value
Definition: TraCIDefs.h:293
std::string getString() const
Definition: TraCIDefs.h:284
std::string getString() const
Definition: TraCIDefs.h:232
std::string stoppingPlaceID
Id assigned to the stop.
Definition: TraCIDefs.h:456
std::string lane
The lane to stop at.
Definition: TraCIDefs.h:450
int stopFlags
Stop flags.
Definition: TraCIDefs.h:458
std::string actType
additional information for this stop
Definition: TraCIDefs.h:474
std::string tripId
id of the trip within a cyclical public transport route
Definition: TraCIDefs.h:476
std::string getString() const
Definition: TraCIDefs.h:441
double startPos
The stopping position start.
Definition: TraCIDefs.h:452
double arrival
The actual arrival time (only for past stops)
Definition: TraCIDefs.h:466
TraCINextStopData(const std::string &lane="", double startPos=INVALID_DOUBLE_VALUE, double endPos=INVALID_DOUBLE_VALUE, const std::string &stoppingPlaceID="", int stopFlags=0, double duration=INVALID_DOUBLE_VALUE, double until=INVALID_DOUBLE_VALUE, double intendedArrival=INVALID_DOUBLE_VALUE, double arrival=INVALID_DOUBLE_VALUE, double depart=INVALID_DOUBLE_VALUE, const std::string &split="", const std::string &join="", const std::string &actType="", const std::string &tripId="", const std::string &line="", double speed=0)
Definition: TraCIDefs.h:407
double depart
The time at which this stop was ended.
Definition: TraCIDefs.h:468
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
Definition: TraCIDefs.h:472
double speed
the speed at which this stop counts as reached (waypoint mode)
Definition: TraCIDefs.h:480
double intendedArrival
The intended arrival time.
Definition: TraCIDefs.h:464
double endPos
The stopping position end.
Definition: TraCIDefs.h:454
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
Definition: TraCIDefs.h:470
std::string line
the new line id of the trip within a cyclical public transport route
Definition: TraCIDefs.h:478
double duration
The intended (minimum) stopping duration.
Definition: TraCIDefs.h:460
double until
The time at which the vehicle may continue its journey.
Definition: TraCIDefs.h:462
A list of vehicle stops.
Definition: TraCIDefs.h:488
std::string getString() const
Definition: TraCIDefs.h:489
std::vector< TraCINextStopData > value
Definition: TraCIDefs.h:499
double dist
The distance to the tls.
Definition: TraCIDefs.h:399
int tlIndex
The tls index of the controlled link.
Definition: TraCIDefs.h:397
std::string id
The id of the next tls.
Definition: TraCIDefs.h:395
char state
The current state of the tls.
Definition: TraCIDefs.h:401
A 3D-position.
Definition: TraCIDefs.h:172
std::string getString() const
Definition: TraCIDefs.h:173
A list of positions.
Definition: TraCIDefs.h:215
std::string getString() const
Definition: TraCIDefs.h:216
std::vector< TraCIPosition > value
Definition: TraCIDefs.h:225
virtual ~TraCIResult()
Definition: TraCIDefs.h:160
virtual std::string getString() const
Definition: TraCIDefs.h:161
virtual int getType() const
Definition: TraCIDefs.h:164
An edgeId, position and laneIndex.
Definition: TraCIDefs.h:184
std::string getString() const
Definition: TraCIDefs.h:187
TraCIRoadPosition(const std::string e, const double p)
Definition: TraCIDefs.h:186
std::string foeId
the tripId or vehicle id of the train that must pass first
Definition: TraCIDefs.h:618
std::string tripId
the tripId or vehicle id of the train that is constrained
Definition: TraCIDefs.h:616
std::string foeSignal
the tlsID of the rail signla that the foe must pass first
Definition: TraCIDefs.h:620
std::string signalId
the idea of the rail signal where this constraint is active
Definition: TraCIDefs.h:614
std::map< std::string, std::string > param
additional parameters
Definition: TraCIDefs.h:630
bool active
whether this constraint is active
Definition: TraCIDefs.h:628
std::string getString() const
Definition: TraCIDefs.h:632
int type
the type of constraint (predecessor:0, insertionPredecessor:1)
Definition: TraCIDefs.h:624
bool mustWait
whether tripId must still wait for foeId to pass foeSignal
Definition: TraCIDefs.h:626
int limit
the number of trains that must be recorded at the foeSignal
Definition: TraCIDefs.h:622
TraCIString(std::string v)
Definition: TraCIDefs.h:258
std::string value
Definition: TraCIDefs.h:265
int getType() const
Definition: TraCIDefs.h:262
std::string getString() const
Definition: TraCIDefs.h:259
std::vector< std::string > value
Definition: TraCIDefs.h:279
std::string getString() const
Definition: TraCIDefs.h:270
mirrors MSInductLoop::VehicleData
Definition: TraCIDefs.h:379
std::string id
The id of the vehicle.
Definition: TraCIDefs.h:381
double entryTime
Entry-time of the vehicle in [s].
Definition: TraCIDefs.h:385
std::string typeID
Type of the vehicle in.
Definition: TraCIDefs.h:389
double length
Length of the vehicle.
Definition: TraCIDefs.h:383
double leaveTime
Leave-time of the vehicle in [s].
Definition: TraCIDefs.h:387