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.dev/sumo
3 // Copyright (C) 2012-2024 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 
31 #include <libsumo/TraCIConstants.h>
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 // ===========================================================================
45 namespace libsumo {
46 class VariableWrapper;
47 }
48 namespace tcpip {
49 class 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 \
63 static 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()); \
65 static void unsubscribe(const std::string& objectID); \
66 static 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()); \
68 static void unsubscribeContext(const std::string& objectID, int domain, double dist); \
69 static const libsumo::SubscriptionResults getAllSubscriptionResults(); \
70 static const libsumo::TraCIResults getSubscriptionResults(const std::string& objectID); \
71 static const libsumo::ContextSubscriptionResults getAllContextSubscriptionResults(); \
72 static const libsumo::SubscriptionResults getContextSubscriptionResults(const std::string& objectID); \
73 static void subscribeParameterWithKey(const std::string& objectID, const std::string& key, double beginTime = libsumo::INVALID_DOUBLE_VALUE, double endTime = libsumo::INVALID_DOUBLE_VALUE); \
74 static const int DOMAIN_ID;
75 
76 #define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM) \
77 const int CLASS::DOMAIN_ID(libsumo::CMD_GET_##DOM##_VARIABLE); \
78 void \
79 CLASS::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 } \
82 void \
83 CLASS::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 } \
86 void \
87 CLASS::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 } \
90 void \
91 CLASS::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 } \
94 const libsumo::SubscriptionResults \
95 CLASS::getAllSubscriptionResults() { \
96  return mySubscriptionResults; \
97 } \
98 const libsumo::TraCIResults \
99 CLASS::getSubscriptionResults(const std::string& objectID) { \
100  return mySubscriptionResults[objectID]; \
101 } \
102 const libsumo::ContextSubscriptionResults \
103 CLASS::getAllContextSubscriptionResults() { \
104  return myContextSubscriptionResults; \
105 } \
106 const libsumo::SubscriptionResults \
107 CLASS::getContextSubscriptionResults(const std::string& objectID) { \
108  return myContextSubscriptionResults[objectID]; \
109 } \
110 void \
111 CLASS::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 \
117 static std::vector<std::string> getIDList(); \
118 static int getIDCount(); \
119 static std::string getParameter(const std::string& objectID, const std::string& key); \
120 static const std::pair<std::string, std::string> getParameterWithKey(const std::string& objectID, const std::string& key); \
121 static void setParameter(const std::string& objectID, const std::string& key, const std::string& value);
122 
123 #define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS) \
124 const std::pair<std::string, std::string> \
125 CLASS::getParameterWithKey(const std::string& objectID, const std::string& key) { \
126  return std::make_pair(key, getParameter(objectID, key)); \
127 }
128 
129 
130 #define SWIGJAVA_CAST(CLASS) \
131 static std::shared_ptr<CLASS> cast(std::shared_ptr<TraCIResult> res) { \
132  return std::dynamic_pointer_cast<CLASS>(res); \
133 }
134 
135 
136 // ===========================================================================
137 // class and type definitions
138 // ===========================================================================
139 namespace libsumo {
144 class TraCIException : public std::runtime_error {
145 public:
147  TraCIException(std::string what)
148  : std::runtime_error(what) {}
149 };
150 
155 class FatalTraCIError : public std::runtime_error {
156 public:
158  FatalTraCIError(std::string what)
159  : std::runtime_error(what) {}
160 };
161 
164 
165 struct TraCIResult {
166  virtual ~TraCIResult() {}
167  virtual std::string getString() const {
168  return "";
169  }
170  virtual int getType() const {
171  return -1;
172  }
173 };
174 
179  std::string getString() const {
180  std::ostringstream os;
181  os << "TraCIPosition(" << x << "," << y;
182  if (z != INVALID_DOUBLE_VALUE) {
183  os << "," << z;
184  }
185  os << ")";
186  return os.str();
187  }
189 #ifdef SWIGJAVA
191 #endif
192 };
193 
199  TraCIRoadPosition(const std::string e, const double p) : edgeID(e), pos(p) {}
200  std::string getString() const {
201  std::ostringstream os;
202  os << "TraCIRoadPosition(" << edgeID << "_" << laneIndex << "," << pos << ")";
203  return os.str();
204  }
205  std::string edgeID = "";
208 #ifdef SWIGJAVA
210 #endif
211 };
212 
217  TraCIColor() : r(0), g(0), b(0), a(255) {}
218  TraCIColor(int r, int g, int b, int a = 255) : r(r), g(g), b(b), a(a) {}
219  std::string getString() const {
220  std::ostringstream os;
221  os << "TraCIColor(" << r << "," << g << "," << b << "," << a << ")";
222  return os.str();
223  }
224  int r, g, b, a;
225 #ifdef SWIGJAVA
227 #endif
228 };
229 
230 
235  std::string getString() const {
236  std::ostringstream os;
237  os << "[";
238  for (const TraCIPosition& v : value) {
239  os << "(" << v.x << "," << v.y << "," << v.z << ")";
240  }
241  os << "]";
242  return os.str();
243  }
244  std::vector<TraCIPosition> value;
245 #ifdef SWIGJAVA
247 #endif
248 };
249 
250 
252  TraCIInt() : value(0) {}
253  TraCIInt(int v) : value(v) {}
254  std::string getString() const {
255  std::ostringstream os;
256  os << value;
257  return os.str();
258  }
259  int value;
260 #ifdef SWIGJAVA
262 #endif
263 };
264 
265 
267  TraCIDouble() : value(0.) {}
268  TraCIDouble(double v) : value(v) {}
269  std::string getString() const {
270  std::ostringstream os;
271  os << value;
272  return os.str();
273  }
274  int getType() const {
275  return libsumo::TYPE_DOUBLE;
276  }
277  double value;
278 #ifdef SWIGJAVA
280 #endif
281 };
282 
283 
285  TraCIString() : value("") {}
286  TraCIString(std::string v) : value(v) {}
287  std::string getString() const {
288  return value;
289  }
290  int getType() const {
291  return libsumo::TYPE_STRING;
292  }
293  std::string value;
294 #ifdef SWIGJAVA
296 #endif
297 };
298 
299 
301  std::string getString() const {
302  std::ostringstream os;
303  os << "[";
304  for (std::string v : value) {
305  os << v << ",";
306  }
307  os << "]";
308  return os.str();
309  }
310  std::vector<std::string> value;
311 #ifdef SWIGJAVA
313 #endif
314 };
315 
316 
318  std::string getString() const {
319  std::ostringstream os;
320  os << "[";
321  for (double v : value) {
322  os << v << ",";
323  }
324  os << "]";
325  return os.str();
326  }
327  std::vector<double> value;
328 #ifdef SWIGJAVA
330 #endif
331 };
332 
333 
335 typedef std::map<int, std::shared_ptr<libsumo::TraCIResult> > TraCIResults;
337 typedef std::map<std::string, libsumo::TraCIResults> SubscriptionResults;
338 typedef std::map<std::string, libsumo::SubscriptionResults> ContextSubscriptionResults;
339 
340 
341 class TraCIPhase {
342 public:
344  TraCIPhase(const double _duration, const std::string& _state, const double _minDur = libsumo::INVALID_DOUBLE_VALUE,
345  const double _maxDur = libsumo::INVALID_DOUBLE_VALUE,
346  const std::vector<int>& _next = std::vector<int>(),
347  const std::string& _name = "") :
348  duration(_duration), state(_state), minDur(_minDur), maxDur(_maxDur), next(_next), name(_name) {}
350 
351  double duration;
352  std::string state;
353  double minDur, maxDur;
354  std::vector<int> next;
355  std::string name;
356 };
357 }
358 
359 
360 #ifdef SWIG
361 %template(TraCIPhaseVector) std::vector<std::shared_ptr<libsumo::TraCIPhase> >; // *NOPAD*
362 #endif
363 
364 
365 namespace libsumo {
366 class TraCILogic {
367 public:
369  TraCILogic(const std::string& _programID, const int _type, const int _currentPhaseIndex,
370  const std::vector<std::shared_ptr<libsumo::TraCIPhase> >& _phases = std::vector<std::shared_ptr<libsumo::TraCIPhase> >())
371  : programID(_programID), type(_type), currentPhaseIndex(_currentPhaseIndex), phases(_phases) {}
373 
374  std::string programID;
375  int type;
377  std::vector<std::shared_ptr<libsumo::TraCIPhase> > phases;
378  std::map<std::string, std::string> subParameter;
379 };
380 
381 
382 class TraCILink {
383 public:
385  TraCILink(const std::string& _from, const std::string& _via, const std::string& _to)
386  : fromLane(_from), viaLane(_via), toLane(_to) {}
388 
389  std::string fromLane;
390  std::string viaLane;
391  std::string toLane;
392 };
393 
394 
396 public:
397  TraCIConnection() {} // this is needed by SWIG when building a vector of this type, please don't use it
398  TraCIConnection(const std::string& _approachedLane, const bool _hasPrio, const bool _isOpen, const bool _hasFoe,
399  const std::string _approachedInternal, const std::string _state, const std::string _direction, const double _length)
400  : approachedLane(_approachedLane), hasPrio(_hasPrio), isOpen(_isOpen), hasFoe(_hasFoe),
401  approachedInternal(_approachedInternal), state(_state), direction(_direction), length(_length) {}
403 
404  std::string approachedLane;
405  bool hasPrio;
406  bool isOpen;
407  bool hasFoe;
408  std::string approachedInternal;
409  std::string state;
410  std::string direction;
411  double length;
412 };
413 
414 
418  std::string id;
420  double length;
422  double entryTime;
424  double leaveTime;
426  std::string typeID;
427 };
428 
429 
432  std::string id;
434  int tlIndex;
436  double dist;
438  char state;
439 };
440 
441 
443 
444  TraCINextStopData(const std::string& lane = "",
445  double startPos = INVALID_DOUBLE_VALUE,
446  double endPos = INVALID_DOUBLE_VALUE,
447  const std::string& stoppingPlaceID = "",
448  int stopFlags = 0,
449  double duration = INVALID_DOUBLE_VALUE,
450  double until = INVALID_DOUBLE_VALUE,
451  double intendedArrival = INVALID_DOUBLE_VALUE,
452  double arrival = INVALID_DOUBLE_VALUE,
453  double depart = INVALID_DOUBLE_VALUE,
454  const std::string& split = "",
455  const std::string& join = "",
456  const std::string& actType = "",
457  const std::string& tripId = "",
458  const std::string& line = "",
459  double speed = 0):
460  lane(lane),
461  startPos(startPos),
462  endPos(endPos),
463  stoppingPlaceID(stoppingPlaceID),
464  stopFlags(stopFlags),
465  duration(duration),
466  until(until),
467  intendedArrival(intendedArrival),
468  arrival(arrival),
469  depart(depart),
470  split(split),
471  join(join),
472  actType(actType),
473  tripId(tripId),
474  line(line),
475  speed(speed)
476  {}
477 
478  std::string getString() const {
479  std::ostringstream os;
480  os << "TraCINextStopData(" << lane << "," << endPos << "," << stoppingPlaceID
481  << "," << stopFlags << "," << duration << "," << until
482  << "," << arrival << ")";
483  return os.str();
484  }
485 
487  std::string lane;
489  double startPos;
491  double endPos;
493  std::string stoppingPlaceID;
497  double duration;
499  double until;
503  double arrival;
505  double depart;
507  std::string split;
509  std::string join;
511  std::string actType;
513  std::string tripId;
515  std::string line;
517  double speed;
518 };
519 
520 
526  std::string getString() const {
527  std::ostringstream os;
528  os << "TraCINextStopDataVector[";
529  for (TraCINextStopData v : value) {
530  os << v.getString() << ",";
531  }
532  os << "]";
533  return os.str();
534  }
535 
536  std::vector<TraCINextStopData> value;
537 };
538 
539 
542  std::string laneID;
544  double length;
546  double occupation;
552  std::vector<std::string> continuationLanes;
553 };
554 
555 
556 class TraCIStage {
557 public:
558  TraCIStage(int type = INVALID_INT_VALUE, const std::string& vType = "", const std::string& line = "", const std::string& destStop = "",
559  const std::vector<std::string>& edges = std::vector<std::string>(),
560  double travelTime = INVALID_DOUBLE_VALUE, double cost = INVALID_DOUBLE_VALUE, double length = INVALID_DOUBLE_VALUE,
561  const std::string& intended = "", double depart = INVALID_DOUBLE_VALUE, double departPos = INVALID_DOUBLE_VALUE,
562  double arrivalPos = INVALID_DOUBLE_VALUE, const std::string& description = "") :
563  type(type), vType(vType), line(line), destStop(destStop), edges(edges), travelTime(travelTime), cost(cost),
564  length(length), intended(intended), depart(depart), departPos(departPos), arrivalPos(arrivalPos), description(description) {}
566  int type;
568  std::string vType;
570  std::string line;
572  std::string destStop;
574  std::vector<std::string> edges;
576  double travelTime;
578  double cost;
580  double length;
582  std::string intended;
584  double depart;
586  double departPos;
588  double arrivalPos;
590  std::string description;
591 };
592 
593 
594 
596 public:
598  TraCIReservation(const std::string& id,
599  const std::vector<std::string>& persons,
600  const std::string& group,
601  const std::string& fromEdge,
602  const std::string& toEdge,
603  double departPos,
604  double arrivalPos,
605  double depart,
606  double reservationTime,
607  int state) :
608  id(id), persons(persons), group(group), fromEdge(fromEdge), toEdge(toEdge), departPos(departPos), arrivalPos(arrivalPos),
609  depart(depart), reservationTime(reservationTime), state(state) {}
611  std::string id;
613  std::vector<std::string> persons;
615  std::string group;
617  std::string fromEdge;
619  std::string toEdge;
621  double departPos;
623  double arrivalPos;
625  double depart;
629  int state;
630 };
631 
634  std::string collider;
635  std::string victim;
636  std::string colliderType;
637  std::string victimType;
639  double victimSpeed;
641  std::string type;
643  std::string lane;
645  double pos;
646 };
647 
648 
651  std::string signalId;
653  std::string tripId;
655  std::string foeId;
657  std::string foeSignal;
659  int limit;
661  int type;
663  bool mustWait;
665  bool active;
667  std::map<std::string, std::string> param;
668 
669  std::string getString() const {
670  std::ostringstream os;
671  os << "TraCISignalConstraint(signalId=" << signalId << ", tripid=" << tripId << ", foeSignal=" << foeSignal << ", foeId=" << foeId << ")";
672  return os.str();
673  }
674 };
675 
676 
679  std::string foeId;
680  double egoDist;
681  double foeDist;
682  double egoExitDist;
683  double foeExitDist;
684  std::string egoLane;
685  std::string foeLane;
688 };
689 
690 }
691 
692 // pop MSVC warnings
693 #ifdef _MSC_VER
694 #pragma warning(pop)
695 #endif
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
#define SWIGJAVA_CAST(CLASS)
Definition: TraCIDefs.h:130
An error which is not recoverable.
Definition: TraCIDefs.h:155
FatalTraCIError(std::string what)
Definition: TraCIDefs.h:158
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:398
std::string approachedLane
Definition: TraCIDefs.h:404
std::string approachedInternal
Definition: TraCIDefs.h:408
An error which allows to continue.
Definition: TraCIDefs.h:144
TraCIException(std::string what)
Definition: TraCIDefs.h:147
std::map< std::string, std::string > subParameter
Definition: TraCIDefs.h:378
std::string programID
Definition: TraCIDefs.h:374
std::vector< std::shared_ptr< libsumo::TraCIPhase > > phases
Definition: TraCIDefs.h:377
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:369
std::vector< int > next
Definition: TraCIDefs.h:354
std::string state
Definition: TraCIDefs.h:352
std::string name
Definition: TraCIDefs.h:355
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:344
double depart
pickup-time
Definition: TraCIDefs.h:625
double departPos
pickup position on the origin edge
Definition: TraCIDefs.h:621
double reservationTime
time when the reservation was made
Definition: TraCIDefs.h:627
double arrivalPos
drop-off position on the destination edge
Definition: TraCIDefs.h:623
std::vector< std::string > persons
The persons ids that are part of this reservation.
Definition: TraCIDefs.h:613
int state
the state of this reservation
Definition: TraCIDefs.h:629
std::string fromEdge
The origin edge id.
Definition: TraCIDefs.h:617
std::string group
The group id of this reservation.
Definition: TraCIDefs.h:615
std::string id
The id of the taxi reservation (usable for traci.vehicle.dispatchTaxi)
Definition: TraCIDefs.h:611
std::string toEdge
The destination edge id.
Definition: TraCIDefs.h:619
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:598
std::string intended
id of the intended vehicle for public transport ride
Definition: TraCIDefs.h:582
int type
The type of stage (walking, driving, ...)
Definition: TraCIDefs.h:566
std::string destStop
The id of the destination stop.
Definition: TraCIDefs.h:572
double length
length in m
Definition: TraCIDefs.h:580
double travelTime
duration of the stage in seconds
Definition: TraCIDefs.h:576
double departPos
position on the lane when starting the stage
Definition: TraCIDefs.h:586
std::string description
arbitrary description string
Definition: TraCIDefs.h:590
std::string line
The line or the id of the vehicle type.
Definition: TraCIDefs.h:570
double cost
effort needed
Definition: TraCIDefs.h:578
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:558
double depart
intended depart time for public transport ride or INVALID_DOUBLE_VALUE
Definition: TraCIDefs.h:584
std::vector< std::string > edges
The sequence of edges to travel.
Definition: TraCIDefs.h:574
double arrivalPos
position on the lane when ending the stage
Definition: TraCIDefs.h:588
std::string vType
The vehicle type when using a private car or bike.
Definition: TraCIDefs.h:568
TRACI_CONST double INVALID_DOUBLE_VALUE
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:338
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:337
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:335
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:544
double occupation
The traffic density along length.
Definition: TraCIDefs.h:546
bool allowsContinuation
Whether this lane allows continuing the route.
Definition: TraCIDefs.h:550
int bestLaneOffset
The offset of this lane from the best lane.
Definition: TraCIDefs.h:548
std::vector< std::string > continuationLanes
The sequence of lanes that best allows continuing the route without lane change.
Definition: TraCIDefs.h:552
std::string laneID
The id of the lane.
Definition: TraCIDefs.h:542
std::string lane
The lane where the collision happended.
Definition: TraCIDefs.h:643
std::string type
The type of collision.
Definition: TraCIDefs.h:641
std::string collider
The ids of the participating vehicles and persons.
Definition: TraCIDefs.h:634
std::string victimType
Definition: TraCIDefs.h:637
double pos
The position of the collision along the lane.
Definition: TraCIDefs.h:645
std::string colliderType
Definition: TraCIDefs.h:636
std::string getString() const
Definition: TraCIDefs.h:219
TraCIColor(int r, int g, int b, int a=255)
Definition: TraCIDefs.h:218
int getType() const
Definition: TraCIDefs.h:274
TraCIDouble(double v)
Definition: TraCIDefs.h:268
std::string getString() const
Definition: TraCIDefs.h:269
std::vector< double > value
Definition: TraCIDefs.h:327
std::string getString() const
Definition: TraCIDefs.h:318
std::string getString() const
Definition: TraCIDefs.h:254
std::string foeId
the id of the vehicle with intersecting trajectory
Definition: TraCIDefs.h:679
std::string stoppingPlaceID
Id assigned to the stop.
Definition: TraCIDefs.h:493
std::string lane
The lane to stop at.
Definition: TraCIDefs.h:487
int stopFlags
Stop flags.
Definition: TraCIDefs.h:495
std::string actType
additional information for this stop
Definition: TraCIDefs.h:511
std::string tripId
id of the trip within a cyclical public transport route
Definition: TraCIDefs.h:513
std::string getString() const
Definition: TraCIDefs.h:478
double startPos
The stopping position start.
Definition: TraCIDefs.h:489
double arrival
The actual arrival time (only for past stops)
Definition: TraCIDefs.h:503
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:444
double depart
The time at which this stop was ended.
Definition: TraCIDefs.h:505
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
Definition: TraCIDefs.h:509
double speed
the speed at which this stop counts as reached (waypoint mode)
Definition: TraCIDefs.h:517
double intendedArrival
The intended arrival time.
Definition: TraCIDefs.h:501
double endPos
The stopping position end.
Definition: TraCIDefs.h:491
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
Definition: TraCIDefs.h:507
std::string line
the new line id of the trip within a cyclical public transport route
Definition: TraCIDefs.h:515
double duration
The intended (minimum) stopping duration.
Definition: TraCIDefs.h:497
double until
The time at which the vehicle may continue its journey.
Definition: TraCIDefs.h:499
A list of vehicle stops.
Definition: TraCIDefs.h:525
std::string getString() const
Definition: TraCIDefs.h:526
std::vector< TraCINextStopData > value
Definition: TraCIDefs.h:536
double dist
The distance to the tls.
Definition: TraCIDefs.h:436
int tlIndex
The tls index of the controlled link.
Definition: TraCIDefs.h:434
std::string id
The id of the next tls.
Definition: TraCIDefs.h:432
char state
The current state of the tls.
Definition: TraCIDefs.h:438
A 2D or 3D-position, for 2D positions z == INVALID_DOUBLE_VALUE.
Definition: TraCIDefs.h:178
std::string getString() const
Definition: TraCIDefs.h:179
A list of positions.
Definition: TraCIDefs.h:234
std::string getString() const
Definition: TraCIDefs.h:235
std::vector< TraCIPosition > value
Definition: TraCIDefs.h:244
virtual ~TraCIResult()
Definition: TraCIDefs.h:166
virtual std::string getString() const
Definition: TraCIDefs.h:167
virtual int getType() const
Definition: TraCIDefs.h:170
An edgeId, position and laneIndex.
Definition: TraCIDefs.h:197
std::string getString() const
Definition: TraCIDefs.h:200
TraCIRoadPosition(const std::string e, const double p)
Definition: TraCIDefs.h:199
std::string foeId
the tripId or vehicle id of the train that must pass first
Definition: TraCIDefs.h:655
std::string tripId
the tripId or vehicle id of the train that is constrained
Definition: TraCIDefs.h:653
std::string foeSignal
the tlsID of the rail signla that the foe must pass first
Definition: TraCIDefs.h:657
std::string signalId
the idea of the rail signal where this constraint is active
Definition: TraCIDefs.h:651
std::map< std::string, std::string > param
additional parameters
Definition: TraCIDefs.h:667
bool active
whether this constraint is active
Definition: TraCIDefs.h:665
std::string getString() const
Definition: TraCIDefs.h:669
int type
the type of constraint (predecessor:0, insertionPredecessor:1)
Definition: TraCIDefs.h:661
bool mustWait
whether tripId must still wait for foeId to pass foeSignal
Definition: TraCIDefs.h:663
int limit
the number of trains that must be recorded at the foeSignal
Definition: TraCIDefs.h:659
TraCIString(std::string v)
Definition: TraCIDefs.h:286
std::string value
Definition: TraCIDefs.h:293
int getType() const
Definition: TraCIDefs.h:290
std::string getString() const
Definition: TraCIDefs.h:287
std::vector< std::string > value
Definition: TraCIDefs.h:310
std::string getString() const
Definition: TraCIDefs.h:301
mirrors MSInductLoop::VehicleData
Definition: TraCIDefs.h:416
std::string id
The id of the vehicle.
Definition: TraCIDefs.h:418
double entryTime
Entry-time of the vehicle in [s].
Definition: TraCIDefs.h:422
std::string typeID
Type of the vehicle in.
Definition: TraCIDefs.h:426
double length
Length of the vehicle.
Definition: TraCIDefs.h:420
double leaveTime
Leave-time of the vehicle in [s].
Definition: TraCIDefs.h:424