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 #include <libsumo/TraCIConstants.h>
26 #include <vector>
27 #include <limits>
28 #include <map>
29 #include <string>
30 #include <stdexcept>
31 #include <sstream>
32 #include <memory>
33 #include <cstring>
34 
35 
36 // ===========================================================================
37 // common declarations
38 // ===========================================================================
39 namespace libsumo {
40 class VariableWrapper;
41 }
42 namespace tcpip {
43 class Storage;
44 }
45 
46 
47 // ===========================================================================
48 // global definitions
49 // ===========================================================================
50 #ifdef LIBTRACI
51 #define LIBSUMO_NAMESPACE libtraci
52 #else
53 #define LIBSUMO_NAMESPACE libsumo
54 #endif
55 
56 #define LIBSUMO_SUBSCRIPTION_API \
57 static void subscribe(const std::string& objectID, const std::vector<int>& varIDs = std::vector<int>({-1}), \
58  double begin = libsumo::INVALID_DOUBLE_VALUE, double end = libsumo::INVALID_DOUBLE_VALUE, const libsumo::TraCIResults& params = libsumo::TraCIResults()); \
59 static void unsubscribe(const std::string& objectID); \
60 static void subscribeContext(const std::string& objectID, int domain, double dist, const std::vector<int>& varIDs = std::vector<int>({-1}), \
61  double begin = libsumo::INVALID_DOUBLE_VALUE, double end = libsumo::INVALID_DOUBLE_VALUE, const libsumo::TraCIResults& params = libsumo::TraCIResults()); \
62 static void unsubscribeContext(const std::string& objectID, int domain, double dist); \
63 static const libsumo::SubscriptionResults getAllSubscriptionResults(); \
64 static const libsumo::TraCIResults getSubscriptionResults(const std::string& objectID); \
65 static const libsumo::ContextSubscriptionResults getAllContextSubscriptionResults(); \
66 static const libsumo::SubscriptionResults getContextSubscriptionResults(const std::string& objectID); \
67 static void subscribeParameterWithKey(const std::string& objectID, const std::string& key, double beginTime = libsumo::INVALID_DOUBLE_VALUE, double endTime = libsumo::INVALID_DOUBLE_VALUE);
68 
69 #define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN) \
70 void \
71 CLASS::subscribe(const std::string& objectID, const std::vector<int>& varIDs, double begin, double end, const libsumo::TraCIResults& params) { \
72  libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOMAIN##_VARIABLE, objectID, varIDs, begin, end, params); \
73 } \
74 void \
75 CLASS::unsubscribe(const std::string& objectID) { \
76  libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOMAIN##_VARIABLE, objectID, std::vector<int>(), libsumo::INVALID_DOUBLE_VALUE, libsumo::INVALID_DOUBLE_VALUE, libsumo::TraCIResults()); \
77 } \
78 void \
79 CLASS::subscribeContext(const std::string& objectID, int domain, double dist, const std::vector<int>& varIDs, double begin, double end, const TraCIResults& params) { \
80  libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOMAIN##_CONTEXT, objectID, varIDs, begin, end, params, domain, dist); \
81 } \
82 void \
83 CLASS::unsubscribeContext(const std::string& objectID, int domain, double dist) { \
84  libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOMAIN##_CONTEXT, objectID, std::vector<int>(), libsumo::INVALID_DOUBLE_VALUE, libsumo::INVALID_DOUBLE_VALUE, libsumo::TraCIResults(), domain, dist); \
85 } \
86 const libsumo::SubscriptionResults \
87 CLASS::getAllSubscriptionResults() { \
88  return mySubscriptionResults; \
89 } \
90 const libsumo::TraCIResults \
91 CLASS::getSubscriptionResults(const std::string& objectID) { \
92  return mySubscriptionResults[objectID]; \
93 } \
94 const libsumo::ContextSubscriptionResults \
95 CLASS::getAllContextSubscriptionResults() { \
96  return myContextSubscriptionResults; \
97 } \
98 const libsumo::SubscriptionResults \
99 CLASS::getContextSubscriptionResults(const std::string& objectID) { \
100  return myContextSubscriptionResults[objectID]; \
101 } \
102 void \
103 CLASS::subscribeParameterWithKey(const std::string& objectID, const std::string& key, double beginTime, double endTime) { \
104  libsumo::Helper::subscribe(libsumo::CMD_SUBSCRIBE_##DOMAIN##_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)}}); \
105 }
106 
107 
108 #define LIBSUMO_ID_PARAMETER_API \
109 static std::vector<std::string> getIDList(); \
110 static int getIDCount(); \
111 static std::string getParameter(const std::string& objectID, const std::string& param); \
112 static const std::pair<std::string, std::string> getParameterWithKey(const std::string& objectID, const std::string& key); \
113 static void setParameter(const std::string& objectID, const std::string& param, const std::string& value);
114 
115 #define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS) \
116 const std::pair<std::string, std::string> \
117 CLASS::getParameterWithKey(const std::string& objectID, const std::string& key) { \
118  return std::make_pair(key, getParameter(objectID, key)); \
119 }
120 
121 
122 // ===========================================================================
123 // class and type definitions
124 // ===========================================================================
125 namespace libsumo {
130 class TraCIException : public std::runtime_error {
131 public:
133  TraCIException(std::string what)
134  : std::runtime_error(what) {}
135 };
136 
141 class FatalTraCIError : public std::runtime_error {
142 public:
144  FatalTraCIError(std::string what)
145  : std::runtime_error(what) {}
146 };
147 
150 
151 struct TraCIResult {
152  virtual ~TraCIResult() {}
153  virtual std::string getString() const {
154  return "";
155  }
156  virtual int getType() const {
157  return -1;
158  }
159 };
160 
165  std::string getString() const {
166  std::ostringstream os;
167  os << "TraCIPosition(" << x << "," << y << "," << z << ")";
168  return os.str();
169  }
171 };
172 
178  TraCIRoadPosition(const std::string e, const double p) : edgeID(e), pos(p) {}
179  std::string getString() const {
180  std::ostringstream os;
181  os << "TraCIRoadPosition(" << edgeID << "_" << laneIndex << "," << pos << ")";
182  return os.str();
183  }
184  std::string edgeID = "";
187 };
188 
193  TraCIColor() : r(0), g(0), b(0), a(255) {}
194  TraCIColor(int r, int g, int b, int a = 255) : r(r), g(g), b(b), a(a) {}
195  std::string getString() const {
196  std::ostringstream os;
197  os << "TraCIColor(" << r << "," << g << "," << b << "," << a << ")";
198  return os.str();
199  }
200  int r, g, b, a;
201 };
202 
203 
208  std::string getString() const {
209  std::ostringstream os;
210  os << "[";
211  for (const TraCIPosition& v : value) {
212  os << "(" << v.x << "," << v.y << "," << v.z << ")";
213  }
214  os << "]";
215  return os.str();
216  }
217  std::vector<TraCIPosition> value;
218 };
219 
220 
222  TraCIInt() : value(0) {}
223  TraCIInt(int v) : value(v) {}
224  std::string getString() const {
225  std::ostringstream os;
226  os << value;
227  return os.str();
228  }
229  int value;
230 };
231 
232 
234  TraCIDouble() : value(0.) {}
235  TraCIDouble(double v) : value(v) {}
236  std::string getString() const {
237  std::ostringstream os;
238  os << value;
239  return os.str();
240  }
241  int getType() const {
242  return libsumo::TYPE_DOUBLE;
243  }
244  double value;
245 };
246 
247 
249  TraCIString() : value("") {}
250  TraCIString(std::string v) : value(v) {}
251  std::string getString() const {
252  return value;
253  }
254  int getType() const {
255  return libsumo::TYPE_STRING;
256  }
257  std::string value;
258 };
259 
260 
262  std::string getString() const {
263  std::ostringstream os;
264  os << "[";
265  for (std::string v : value) {
266  os << v << ",";
267  }
268  os << "]";
269  return os.str();
270  }
271  std::vector<std::string> value;
272 };
273 
274 
276 typedef std::map<int, std::shared_ptr<libsumo::TraCIResult> > TraCIResults;
278 typedef std::map<std::string, libsumo::TraCIResults> SubscriptionResults;
279 typedef std::map<std::string, libsumo::SubscriptionResults> ContextSubscriptionResults;
280 
281 
282 class TraCIPhase {
283 public:
285  TraCIPhase(const double _duration, const std::string& _state, const double _minDur = libsumo::INVALID_DOUBLE_VALUE,
286  const double _maxDur = libsumo::INVALID_DOUBLE_VALUE,
287  const std::vector<int>& _next = std::vector<int>(),
288  const std::string& _name = "") :
289  duration(_duration), state(_state), minDur(_minDur), maxDur(_maxDur), next(_next), name(_name) {}
291 
292  double duration;
293  std::string state;
294  double minDur, maxDur;
295  std::vector<int> next;
296  std::string name;
297 };
298 }
299 
300 
301 #ifdef SWIG
302 %template(TraCIPhaseVector) std::vector<std::shared_ptr<libsumo::TraCIPhase> >; // *NOPAD*
303 #endif
304 
305 
306 namespace libsumo {
307 class TraCILogic {
308 public:
310  TraCILogic(const std::string& _programID, const int _type, const int _currentPhaseIndex,
311  const std::vector<std::shared_ptr<libsumo::TraCIPhase> >& _phases = std::vector<std::shared_ptr<libsumo::TraCIPhase> >())
312  : programID(_programID), type(_type), currentPhaseIndex(_currentPhaseIndex), phases(_phases) {}
314 
315  std::string programID;
316  int type;
318  std::vector<std::shared_ptr<libsumo::TraCIPhase> > phases;
319  std::map<std::string, std::string> subParameter;
320 };
321 
322 
323 class TraCILink {
324 public:
326  TraCILink(const std::string& _from, const std::string& _via, const std::string& _to)
327  : fromLane(_from), viaLane(_via), toLane(_to) {}
329 
330  std::string fromLane;
331  std::string viaLane;
332  std::string toLane;
333 };
334 
335 
337 public:
338  TraCIConnection() {} // this is needed by SWIG when building a vector of this type, please don't use it
339  TraCIConnection(const std::string& _approachedLane, const bool _hasPrio, const bool _isOpen, const bool _hasFoe,
340  const std::string _approachedInternal, const std::string _state, const std::string _direction, const double _length)
341  : approachedLane(_approachedLane), hasPrio(_hasPrio), isOpen(_isOpen), hasFoe(_hasFoe),
342  approachedInternal(_approachedInternal), state(_state), direction(_direction), length(_length) {}
344 
345  std::string approachedLane;
346  bool hasPrio;
347  bool isOpen;
348  bool hasFoe;
349  std::string approachedInternal;
350  std::string state;
351  std::string direction;
352  double length;
353 };
354 
355 
359  std::string id;
361  double length;
363  double entryTime;
365  double leaveTime;
367  std::string typeID;
368 };
369 
370 
373  std::string id;
375  int tlIndex;
377  double dist;
379  char state;
380 };
381 
382 
384 
385  TraCINextStopData(const std::string& lane = "",
386  double startPos = INVALID_DOUBLE_VALUE,
387  double endPos = INVALID_DOUBLE_VALUE,
388  const std::string& stoppingPlaceID = "",
389  int stopFlags = 0,
390  double duration = INVALID_DOUBLE_VALUE,
391  double until = INVALID_DOUBLE_VALUE,
392  double intendedArrival = INVALID_DOUBLE_VALUE,
393  double arrival = INVALID_DOUBLE_VALUE,
394  double depart = INVALID_DOUBLE_VALUE,
395  const std::string& split = "",
396  const std::string& join = "",
397  const std::string& actType = "",
398  const std::string& tripId = "",
399  const std::string& line = "",
400  double speed = 0):
401  lane(lane),
402  startPos(startPos),
403  endPos(endPos),
404  stoppingPlaceID(stoppingPlaceID),
405  stopFlags(stopFlags),
406  duration(duration),
407  until(until),
408  intendedArrival(intendedArrival),
409  arrival(arrival),
410  depart(depart),
411  split(split),
412  join(join),
413  actType(actType),
414  tripId(tripId),
415  line(line),
416  speed(speed)
417  {}
418 
419  std::string getString() const {
420  std::ostringstream os;
421  os << "TraCINextStopData(" << lane << "," << endPos << "," << stoppingPlaceID
422  << "," << stopFlags << "," << duration << "," << until
423  << "," << arrival << ")";
424  return os.str();
425  }
426 
428  std::string lane;
430  double startPos;
432  double endPos;
434  std::string stoppingPlaceID;
438  double duration;
440  double until;
444  double arrival;
446  double depart;
448  std::string split;
450  std::string join;
452  std::string actType;
454  std::string tripId;
456  std::string line;
458  double speed;
459 };
460 
461 
467  std::string getString() const {
468  std::ostringstream os;
469  os << "TraCINextStopDataVector[";
470  for (TraCINextStopData v : value) {
471  os << v.getString() << ",";
472  }
473  os << "]";
474  return os.str();
475  }
476 
477  std::vector<TraCINextStopData> value;
478 };
479 
480 
483  std::string laneID;
485  double length;
487  double occupation;
493  std::vector<std::string> continuationLanes;
494 };
495 
496 
497 class TraCIStage {
498 public:
499  TraCIStage(int type = INVALID_INT_VALUE, const std::string& vType = "", const std::string& line = "", const std::string& destStop = "",
500  const std::vector<std::string>& edges = std::vector<std::string>(),
501  double travelTime = INVALID_DOUBLE_VALUE, double cost = INVALID_DOUBLE_VALUE, double length = INVALID_DOUBLE_VALUE,
502  const std::string& intended = "", double depart = INVALID_DOUBLE_VALUE, double departPos = INVALID_DOUBLE_VALUE,
503  double arrivalPos = INVALID_DOUBLE_VALUE, const std::string& description = "") :
504  type(type), vType(vType), line(line), destStop(destStop), edges(edges), travelTime(travelTime), cost(cost),
505  length(length), intended(intended), depart(depart), departPos(departPos), arrivalPos(arrivalPos), description(description) {}
507  int type;
509  std::string vType;
511  std::string line;
513  std::string destStop;
515  std::vector<std::string> edges;
517  double travelTime;
519  double cost;
521  double length;
523  std::string intended;
525  double depart;
527  double departPos;
529  double arrivalPos;
531  std::string description;
532 };
533 
534 
535 
537 public:
539  TraCIReservation(const std::string& id,
540  const std::vector<std::string>& persons,
541  const std::string& group,
542  const std::string& fromEdge,
543  const std::string& toEdge,
544  double departPos,
545  double arrivalPos,
546  double depart,
547  double reservationTime,
548  int state) :
549  id(id), persons(persons), group(group), fromEdge(fromEdge), toEdge(toEdge), departPos(departPos), arrivalPos(arrivalPos),
550  depart(depart), reservationTime(reservationTime), state(state) {}
552  std::string id;
554  std::vector<std::string> persons;
556  std::string group;
558  std::string fromEdge;
560  std::string toEdge;
562  double departPos;
564  double arrivalPos;
566  double depart;
570  int state;
571 };
572 
575  std::string collider;
576  std::string victim;
577  std::string colliderType;
578  std::string victimType;
580  double victimSpeed;
582  std::string type;
584  std::string lane;
586  double pos;
587 };
588 
589 
592  std::string signalId;
594  std::string tripId;
596  std::string foeId;
598  std::string foeSignal;
600  int limit;
602  int type;
604  bool mustWait;
605 
606  std::string getString() const {
607  std::ostringstream os;
608  os << "TraCISignalConstraint(signalId=" << signalId << ", tripid=" << tripId << ", foeSignal=" << foeSignal << ", foeId=" << foeId << ")";
609  return os.str();
610  }
611 };
612 
613 }
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:141
FatalTraCIError(std::string what)
Definition: TraCIDefs.h:144
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:339
std::string approachedLane
Definition: TraCIDefs.h:345
std::string approachedInternal
Definition: TraCIDefs.h:349
An error which allows to continue.
Definition: TraCIDefs.h:130
TraCIException(std::string what)
Definition: TraCIDefs.h:133
std::map< std::string, std::string > subParameter
Definition: TraCIDefs.h:319
std::string programID
Definition: TraCIDefs.h:315
std::vector< std::shared_ptr< libsumo::TraCIPhase > > phases
Definition: TraCIDefs.h:318
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:310
std::vector< int > next
Definition: TraCIDefs.h:295
std::string state
Definition: TraCIDefs.h:293
std::string name
Definition: TraCIDefs.h:296
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:285
double depart
pickup-time
Definition: TraCIDefs.h:566
double departPos
pickup position on the origin edge
Definition: TraCIDefs.h:562
double reservationTime
time when the reservation was made
Definition: TraCIDefs.h:568
double arrivalPos
drop-off position on the destination edge
Definition: TraCIDefs.h:564
std::vector< std::string > persons
The persons ids that are part of this reservation.
Definition: TraCIDefs.h:554
int state
the state of this reservation
Definition: TraCIDefs.h:570
std::string fromEdge
The origin edge id.
Definition: TraCIDefs.h:558
std::string group
The group id of this reservation.
Definition: TraCIDefs.h:556
std::string id
The id of the taxi reservation (usable for traci.vehicle.dispatchTaxi)
Definition: TraCIDefs.h:552
std::string toEdge
The destination edge id.
Definition: TraCIDefs.h:560
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:539
std::string intended
id of the intended vehicle for public transport ride
Definition: TraCIDefs.h:523
int type
The type of stage (walking, driving, ...)
Definition: TraCIDefs.h:507
std::string destStop
The id of the destination stop.
Definition: TraCIDefs.h:513
double length
length in m
Definition: TraCIDefs.h:521
double travelTime
duration of the stage in seconds
Definition: TraCIDefs.h:517
double departPos
position on the lane when starting the stage
Definition: TraCIDefs.h:527
std::string description
arbitrary description string
Definition: TraCIDefs.h:531
std::string line
The line or the id of the vehicle type.
Definition: TraCIDefs.h:511
double cost
effort needed
Definition: TraCIDefs.h:519
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:499
double depart
intended depart time for public transport ride or INVALID_DOUBLE_VALUE
Definition: TraCIDefs.h:525
std::vector< std::string > edges
The sequence of edges to travel.
Definition: TraCIDefs.h:515
double arrivalPos
position on the lane when ending the stage
Definition: TraCIDefs.h:529
std::string vType
The vehicle type when using a private car or bike.
Definition: TraCIDefs.h:509
TRACI_CONST double INVALID_DOUBLE_VALUE
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:279
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:278
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:276
TRACI_CONST int TYPE_STRING
Definition: socket.cpp:62
double length
The length than can be driven from that lane without lane change.
Definition: TraCIDefs.h:485
double occupation
The traffic density along length.
Definition: TraCIDefs.h:487
bool allowsContinuation
Whether this lane allows continuing the route.
Definition: TraCIDefs.h:491
int bestLaneOffset
The offset of this lane from the best lane.
Definition: TraCIDefs.h:489
std::vector< std::string > continuationLanes
The sequence of lanes that best allows continuing the route without lane change.
Definition: TraCIDefs.h:493
std::string laneID
The id of the lane.
Definition: TraCIDefs.h:483
std::string lane
The lane where the collision happended.
Definition: TraCIDefs.h:584
std::string type
The type of collision.
Definition: TraCIDefs.h:582
std::string collider
The ids of the participating vehicles and persons.
Definition: TraCIDefs.h:575
std::string victimType
Definition: TraCIDefs.h:578
double pos
The position of the collision along the lane.
Definition: TraCIDefs.h:586
std::string colliderType
Definition: TraCIDefs.h:577
std::string getString() const
Definition: TraCIDefs.h:195
TraCIColor(int r, int g, int b, int a=255)
Definition: TraCIDefs.h:194
int getType() const
Definition: TraCIDefs.h:241
TraCIDouble(double v)
Definition: TraCIDefs.h:235
std::string getString() const
Definition: TraCIDefs.h:236
std::string getString() const
Definition: TraCIDefs.h:224
std::string stoppingPlaceID
Id assigned to the stop.
Definition: TraCIDefs.h:434
std::string lane
The lane to stop at.
Definition: TraCIDefs.h:428
int stopFlags
Stop flags.
Definition: TraCIDefs.h:436
std::string actType
additional information for this stop
Definition: TraCIDefs.h:452
std::string tripId
id of the trip within a cyclical public transport route
Definition: TraCIDefs.h:454
std::string getString() const
Definition: TraCIDefs.h:419
double startPos
The stopping position start.
Definition: TraCIDefs.h:430
double arrival
The actual arrival time (only for past stops)
Definition: TraCIDefs.h:444
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:385
double depart
The time at which this stop was ended.
Definition: TraCIDefs.h:446
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
Definition: TraCIDefs.h:450
double speed
the speed at which this stop counts as reached (waypoint mode)
Definition: TraCIDefs.h:458
double intendedArrival
The intended arrival time.
Definition: TraCIDefs.h:442
double endPos
The stopping position end.
Definition: TraCIDefs.h:432
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
Definition: TraCIDefs.h:448
std::string line
the new line id of the trip within a cyclical public transport route
Definition: TraCIDefs.h:456
double duration
The intended (minimum) stopping duration.
Definition: TraCIDefs.h:438
double until
The time at which the vehicle may continue its journey.
Definition: TraCIDefs.h:440
A list of vehicle stops.
Definition: TraCIDefs.h:466
std::string getString() const
Definition: TraCIDefs.h:467
std::vector< TraCINextStopData > value
Definition: TraCIDefs.h:477
double dist
The distance to the tls.
Definition: TraCIDefs.h:377
int tlIndex
The tls index of the controlled link.
Definition: TraCIDefs.h:375
std::string id
The id of the next tls.
Definition: TraCIDefs.h:373
char state
The current state of the tls.
Definition: TraCIDefs.h:379
A 3D-position.
Definition: TraCIDefs.h:164
std::string getString() const
Definition: TraCIDefs.h:165
A list of positions.
Definition: TraCIDefs.h:207
std::string getString() const
Definition: TraCIDefs.h:208
std::vector< TraCIPosition > value
Definition: TraCIDefs.h:217
virtual ~TraCIResult()
Definition: TraCIDefs.h:152
virtual std::string getString() const
Definition: TraCIDefs.h:153
virtual int getType() const
Definition: TraCIDefs.h:156
An edgeId, position and laneIndex.
Definition: TraCIDefs.h:176
std::string getString() const
Definition: TraCIDefs.h:179
TraCIRoadPosition(const std::string e, const double p)
Definition: TraCIDefs.h:178
std::string foeId
the tripId or vehicle id of the train that must pass first
Definition: TraCIDefs.h:596
std::string tripId
the tripId or vehicle id of the train that is constrained
Definition: TraCIDefs.h:594
std::string foeSignal
the tlsID of the rail signla that the foe must pass first
Definition: TraCIDefs.h:598
std::string signalId
the idea of the rail signal where this constraint is active
Definition: TraCIDefs.h:592
std::string getString() const
Definition: TraCIDefs.h:606
int type
the type of constraint (predecessor:0, insertionPredecessor:1)
Definition: TraCIDefs.h:602
bool mustWait
whether tripId must still wait for foeId to pass foeSignal
Definition: TraCIDefs.h:604
int limit
the number of trains that must be recorded at the foeSignal
Definition: TraCIDefs.h:600
TraCIString(std::string v)
Definition: TraCIDefs.h:250
std::string value
Definition: TraCIDefs.h:257
int getType() const
Definition: TraCIDefs.h:254
std::string getString() const
Definition: TraCIDefs.h:251
std::vector< std::string > value
Definition: TraCIDefs.h:271
std::string getString() const
Definition: TraCIDefs.h:262
mirrors MSInductLoop::VehicleData
Definition: TraCIDefs.h:357
std::string id
The id of the vehicle.
Definition: TraCIDefs.h:359
double entryTime
Entry-time of the vehicle in [s].
Definition: TraCIDefs.h:363
std::string typeID
Type of the vehicle in.
Definition: TraCIDefs.h:367
double length
Length of the vehicle.
Definition: TraCIDefs.h:361
double leaveTime
Leave-time of the vehicle in [s].
Definition: TraCIDefs.h:365