Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MELoop.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// The main mesocopic simulation loop
19/****************************************************************************/
20#include <config.h>
21
22#include <queue>
23#include <vector>
24#include <map>
25#include <cmath>
26
27#include <microsim/MSNet.h>
28#include <microsim/MSEdge.h>
29#include <microsim/MSGlobals.h>
30#include <microsim/MSLane.h>
31#include <microsim/MSVehicle.h>
38#include "MELoop.h"
39#include "MESegment.h"
40#include "MELSegment.h"
41#include "MEVehicle.h"
42
44
45// ===========================================================================
46// method definitions
47// ===========================================================================
48MELoop::MELoop(const SUMOTime recheckInterval) : myFullRecheckInterval(recheckInterval), myLinkRecheckInterval(TIME2STEPS(1)) {
49}
50
52 for (std::vector<MESegment*>::const_iterator j = myEdges2FirstSegments.begin(); j != myEdges2FirstSegments.end(); ++j) {
53 for (MESegment* s = *j; s != nullptr;) {
54 MESegment* n = s->getNextSegment();
55 delete s;
56 s = n;
57 }
58 }
59}
60
61
62void
64 while (!myLeaderCars.empty()) {
65 LeaderEvent e = myLeaderCars.top();
66 assert(e.time > tMax - DELTA_T);
67 if (e.time > tMax) {
68 return;
69 }
70 myLeaderCars.pop();
71 while (!myInvalidatedLeaderCars.empty() && e.time > myInvalidatedLeaderCars.top().time) {
73 }
74 if (!myInvalidatedLeaderCars.empty()) {
75 if (wasInvalidated(e)) {
76 continue;
77 }
78 }
79 //std::cout << SIMTIME << " checkChar " << e.veh->getID() << " on=" << e.veh->getSegment()->getID() << " t=" << e.time << " nid=" << e.veh->getNumericalID() << "\n";
80 checkCar(e.veh);
81 assert(myLeaderCars.empty() || myLeaderCars.top().time >= e.time);
82 }
83}
84
85
86bool
88 if (e.time == myInvalidatedLeaderCars.top().time) {
89 // we need to check whether any of the events with the same time
90 // is our current vehicle because the order in which
91 // removeLeaderCar was called is unrelated to the order of addLeaderCar
92 std::vector<LeaderEvent> tmp;
93 bool curInvalid = false;
94 while (!myInvalidatedLeaderCars.empty() && e.time == myInvalidatedLeaderCars.top().time) {
95 if (e == myInvalidatedLeaderCars.top()) {
97 curInvalid = true;
98 break;
99 } else {
100 tmp.push_back(myInvalidatedLeaderCars.top());
102 }
103 }
104 for (LeaderEvent& le : tmp) {
106 }
107 return curInvalid;
108 }
109 return false;
110}
111
112
114MELoop::changeSegment(MEVehicle* veh, SUMOTime leaveTime, MESegment* const toSegment, MSMoveReminder::Notification reason, const bool ignoreLink) const {
115 int qIdx = 0;
116 MESegment* const onSegment = veh->getSegment();
117 if (MESegment::isInvalid(toSegment)) {
118 if (veh->isStoppedTriggered()) {
119 return leaveTime + MAX2(SUMOTime(1), myLinkRecheckInterval);
120 }
121 if (onSegment != nullptr) {
122 onSegment->send(veh, toSegment, qIdx, leaveTime, reason);
123 } else {
124 WRITE_WARNINGF(TL("Vehicle '%' teleports beyond arrival edge '%', time=%."),
125 veh->getID(), veh->getEdge()->getID(), time2string(leaveTime));
126 }
127 veh->setSegment(toSegment); // signal arrival
129 return leaveTime;
131 && !ignoreLink
132 && !MESegment::isInvalid(onSegment)
133 && &onSegment->getEdge() != &toSegment->getEdge()
134 && veh->getEdge()->allowedLanes(*veh->succEdge(1), veh->getVClass()) == nullptr) {
135 if (veh->isStopped()) {
136 veh->processStop();
137 }
138 // all queues on the next segment are forbidden. We don't want to check
139 // too often whether the forbiden edge has become permitted again
141 if (ttt > 0) {
142 // if teleporting is enabled, make sure we look at the vehicle when the gridlock-time is up
144 return MAX2(MIN2(leaveTime + myLinkRecheckInterval, MIN2(veh->getBlockTime(), leaveTime) + recheck + 1), leaveTime + 1);
145 }
146 return leaveTime + myLinkRecheckInterval;
147 }
148 toSegment->updateEntryBlockTime(leaveTime);
149 const SUMOTime entry = toSegment->hasSpaceFor(veh, leaveTime, qIdx);
150 if (entry == leaveTime && (ignoreLink || veh->mayProceed())) {
151 if (onSegment != nullptr) {
152 if (veh->getQueIndex() == MESegment::PARKING_QUEUE) { // parking or just aborted parking
153 if (veh->isParking()) {
154 veh->processStop();
155 }
156 veh->getEdge()->getLanes()[0]->removeParking(veh); // TODO for GUI only
157 } else {
158 onSegment->send(veh, toSegment, qIdx, leaveTime, onSegment->getNextSegment() == nullptr ? MSMoveReminder::NOTIFICATION_JUNCTION : MSMoveReminder::NOTIFICATION_SEGMENT);
159 }
160 toSegment->receive(veh, qIdx, leaveTime, false, ignoreLink, &onSegment->getEdge() != &toSegment->getEdge());
161 } else {
162 WRITE_WARNINGF(TL("Vehicle '%' ends teleporting on edge '%':%, time=%."),
163 veh->getID(), toSegment->getEdge().getID(), toSegment->getIndex(), time2string(leaveTime));
164 // this is not quite correct but suffices for interrogation by
165 // subsequent methods (veh->getSpeed() needs segment != 0)
167 // clean up detectors (do not add traffic data)
168 // note: updateDatector is not called if leaveTime == getLastEntryTime()
170 toSegment->receive(veh, qIdx, leaveTime, false, true, true);
171 }
172 return entry;
173 } else {
174 if (veh->getQueIndex() != MESegment::PARKING_QUEUE && veh->isStopped() && veh->endTriggeredStop()) {
175 veh->processStop();
176 }
177 }
178 if (entry == leaveTime && !ignoreLink) { // this is a long way of saying !veh->mayProceed() (which is a costly call)
179 return entry + MAX2(SUMOTime(1), myLinkRecheckInterval);
180 }
181 return entry;
182}
183
184
185void
187 const SUMOTime leaveTime = veh->getEventTime();
188 MESegment* const onSegment = veh->getSegment();
189 MESegment* const toSegment = veh->getQueIndex() == MESegment::PARKING_QUEUE ? onSegment : nextSegment(onSegment, veh);
190 const bool teleporting = (onSegment == nullptr); // is the vehicle currently teleporting?
191 // @note reason is only evaluated if toSegment == nullptr
192 const SUMOTime nextEntry = changeSegment(veh, leaveTime, toSegment, MSMoveReminder::NOTIFICATION_ARRIVED, teleporting);
193 if (nextEntry == leaveTime) {
194 return;
195 }
197 const bool r1 = ttt > 0 && veh->getWaitingTime() > ttt;
199 if (!veh->isStopped() && (r1 || r3)) {
200 const bool disconnected = (MSGlobals::gTimeToTeleportDisconnected >= 0
201 && veh->succEdge(1) != nullptr
202 && veh->getEdge()->allowedLanes(*veh->succEdge(1), veh->getVClass()) == nullptr);
203 if ((r1 && !disconnected) || (r3 && disconnected)) {
204 teleportVehicle(veh, toSegment, disconnected);
205 return;
206 }
207 }
208 if (veh->getBlockTime() == SUMOTime_MAX && (!veh->isStopped()
209 || (!veh->isStoppedTriggered() && veh->isStoppedParking()))) {
210 veh->setBlockTime(leaveTime);
211 }
212 if (nextEntry == SUMOTime_MAX) {
213 // all usable queues on the next segment are full
214 SUMOTime newEventTime = MAX3(toSegment->getEventTime() + 1, leaveTime + 1, leaveTime + myFullRecheckInterval);
215 if (ttt) {
216 // if teleporting is enabled, make sure we look at the vehicle when the gridlock-time is up
217 const SUMOTime recheck = veh->getBlockTime() + 1 + ttt;
218 if (recheck > leaveTime) {
219 newEventTime = MIN2(newEventTime, recheck);
220 }
221 }
224 if (recheck > leaveTime && veh->getEdge()->allowedLanes(*veh->succEdge(1), veh->getVClass()) == nullptr) {
225 newEventTime = MIN2(newEventTime, recheck);
226 }
227 }
228 veh->setEventTime(newEventTime);
229 } else {
230 // receiving segment has recently received another vehicle or the junction is blocked
231 veh->setEventTime(nextEntry);
232 }
233 addLeaderCar(veh, teleporting ? nullptr : onSegment->getLink(veh));
234}
235
236
237void
238MELoop::teleportVehicle(MEVehicle* veh, MESegment* const toSegment, bool disconnected) {
239 const SUMOTime leaveTime = veh->getEventTime();
240 MESegment* const onSegment = veh->getSegment();
242 WRITE_WARNINGF(TL("Teleporting vehicle '%'; waited too long, from edge '%':%, time=%."),
243 veh->getID(), onSegment->getEdge().getID(), onSegment->getIndex(),
244 time2string(leaveTime));
246 int qIdx = 0;
247 onSegment->send(veh, nullptr, qIdx, leaveTime, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED);
248 veh->setSegment(nullptr);
250 return;
251 }
252 const bool teleporting = (onSegment == nullptr); // is the vehicle already teleporting?
253 // try to find a place on the current edge
254 MESegment* teleSegment = disconnected ? toSegment : toSegment->getNextSegment();
255 while (teleSegment != nullptr && changeSegment(veh, leaveTime, teleSegment, MSMoveReminder::NOTIFICATION_TELEPORT, true) != leaveTime) {
256 // @caution the time to get to the next segment here is ignored XXX
257 teleSegment = teleSegment->getNextSegment();
258 }
259 if (teleSegment != nullptr) {
260 if (!teleporting) {
261 // we managed to teleport in a single jump
262 const std::string reason = disconnected ? " (disconnected)" : "";
263 WRITE_WARNINGF(TL("Teleporting vehicle '%'; waited too long%, from edge '%':% to edge '%':%, time=%."),
264 veh->getID(), reason, onSegment->getEdge().getID(), onSegment->getIndex(),
265 teleSegment->getEdge().getID(), teleSegment->getIndex(), time2string(leaveTime));
267 }
268 } else {
269 // teleport across the current edge and try insertion later
270 if (!teleporting) {
271 int qIdx = 0;
272 // announce start of multi-step teleport, arrival will be announced in changeSegment()
273 WRITE_WARNINGF(TL("Teleporting vehicle '%'; waited too long, from edge '%':%, time=%."),
274 veh->getID(), onSegment->getEdge().getID(), onSegment->getIndex(), time2string(leaveTime));
276 // remove from current segment
277 onSegment->send(veh, nullptr, qIdx, leaveTime, MSMoveReminder::NOTIFICATION_TELEPORT);
278 // mark veh as teleporting
279 veh->setSegment(nullptr);
280 } else {
282 }
283 // @caution microsim uses current travel time teleport duration
284 const SUMOTime teleArrival = leaveTime + TIME2STEPS(veh->getEdge()->getLength() / MAX2(veh->getEdge()->getSpeedLimit(), NUMERICAL_EPS));
285 const bool atDest = veh->moveRoutePointer();
286 if (atDest) {
287 // teleporting to end of route
288 changeSegment(veh, teleArrival, nullptr, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, true);
289 } else {
290 veh->setEventTime(teleArrival);
291 addLeaderCar(veh, nullptr);
292 // teleporting vehicles must react to rerouters
295 }
296 }
297}
298
299
300void
302 myLeaderCars.push(LeaderEvent(veh));
303 veh->setApproaching(link);
304}
305
306
307void
312
313
314void
318
319
320void
322 int qIdx = 0;
323 v->getSegment()->send(v, nullptr, qIdx, MSNet::getInstance()->getCurrentTimeStep(), reason);
325}
326
327
330 if (s != nullptr) { // vehicle is not teleporting
331 MESegment* next = s->getNextSegment();
332 if (next != nullptr) {
333 // ok, the street continues
334 return next;
335 }
336 }
337 // we have to check the next edge in the vehicle's route
338 const MSEdge* nextEdge = v->succEdge(1);
339 if (nextEdge == nullptr) {
340 // end of route
341 return nullptr;
342 }
343 if (MSGlobals::gUsingInternalLanes && s != nullptr && s->getEdge().isNormal()) {
344 const MSEdge* internal = s->getEdge().getInternalFollowingEdge(nextEdge, v->getVClass());
345 if (internal) {
346 nextEdge = internal;
347 }
348 }
349 return myEdges2FirstSegments[nextEdge->getNumericalID()];
350}
351
352
353int
354MELoop::numSegmentsFor(const double length, const double sLength) {
355 int no = (int)floor(length / sLength + 0.5);
356 if (no == 0) { // assure there is at least one segment
357 return 1;
358 } else {
359 return no;
360 }
361}
362
363
364void
367 const double length = e.getLength();
368 const int numSegments = numSegmentsFor(length, edgeType.edgeLength);
369 const double slength = length / (double)numSegments;
370 MESegment* newSegment = nullptr;
371 MESegment* nextSegment = nullptr;
372 const bool laneQueue = oc.getBool("meso-lane-queue");
373 const bool lift = oc.getBool("meso-ltm");
374 bool multiQueue = laneQueue || (oc.getBool("meso-multi-queue") && e.getLanes().size() > 1 && e.getNumSuccessors() > 1);
375 for (int s = numSegments - 1; s >= 0; s--) {
376 std::string id = e.getID() + ":" + toString(s);
377 newSegment = lift
378 ? new MELSegment(id, e, nextSegment, slength, e.getLanes()[0]->getSpeedLimit(), s, multiQueue, edgeType)
379 : new MESegment(id, e, nextSegment, slength, e.getLanes()[0]->getSpeedLimit(), s, multiQueue, edgeType);
380 multiQueue = laneQueue;
381 nextSegment = newSegment;
382 }
383 while (e.getNumericalID() >= static_cast<int>(myEdges2FirstSegments.size())) {
384 myEdges2FirstSegments.push_back(0);
385 }
386 myEdges2FirstSegments[e.getNumericalID()] = newSegment;
387 for (MSLane* lane : e.getLanes()) {
388 lane->updateMesoGUISegments();
389 }
390}
391
392
394MELoop::getSegmentForEdge(const MSEdge& e, double pos) {
395 if (e.getNumericalID() >= (int)myEdges2FirstSegments.size()) {
396 return nullptr;
397 }
399 if (pos > 0) {
400 double cpos = 0;
401 while (s->getNextSegment() != nullptr && cpos + s->getLength() < pos) {
402 cpos += s->getLength();
403 s = s->getNextSegment();
404 }
405 }
406 return s;
407}
408
409
410bool
412 for (const MSEdge* succ : e.getSuccessors()) {
413 if (succ->isRoundabout()) {
414 return true;
415 }
416 }
417 return false;
418}
419
420
422 time(v->getEventTime()),
423 eventIndex(myEventCounter++),
424 nid(v->getNumericalID()),
425 veh(v) { }
426
427/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:287
#define TL(string)
Definition MsgHandler.h:304
SUMOTime DELTA_T
Definition SUMOTime.cpp:38
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:91
constexpr SUMOTime TIME2STEPS(double x)
Definition SUMOTime.h:60
#define SUMOTime_MAX
Definition SUMOTime.h:34
T MIN2(T a, T b)
Definition StdDefs.h:80
T MAX2(T a, T b)
Definition StdDefs.h:86
T MAX3(T a, T b, T c)
Definition StdDefs.h:100
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
A single mesoscopic segment (cell)
Definition MELSegment.h:38
MESegment * nextSegment(MESegment *s, MEVehicle *v)
Retrieve next segment.
Definition MELoop.cpp:329
static bool isEnteringRoundabout(const MSEdge &e)
whether the given edge is entering a roundabout
Definition MELoop.cpp:411
bool wasInvalidated(const LeaderEvent &e)
check whether the current car was invalidated and remove it from myInvalidatedLeaderCars
Definition MELoop.cpp:87
LeaderEventQeue myInvalidatedLeaderCars
Definition MELoop.h:171
MELoop(const SUMOTime recheckInterval)
SUMO constructor.
Definition MELoop.cpp:48
SUMOTime changeSegment(MEVehicle *veh, SUMOTime leaveTime, MESegment *const toSegment, MSMoveReminder::Notification reason, const bool ignoreLink=false) const
change to the next segment this handles combinations of the following cases: (ending / continuing rou...
Definition MELoop.cpp:114
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
Definition MELoop.cpp:394
const SUMOTime myLinkRecheckInterval
the interval at which to recheck at blocked junctions (<=0 means asap)
Definition MELoop.h:180
void simulate(SUMOTime tMax)
Perform simulation up to the given time.
Definition MELoop.cpp:63
const SUMOTime myFullRecheckInterval
the interval at which to recheck at full segments (<=0 means asap)
Definition MELoop.h:177
void vaporizeCar(MEVehicle *v, MSMoveReminder::Notification reason)
remove the given car and clean up the relevant data structures
Definition MELoop.cpp:321
void addLeaderCar(MEVehicle *veh, MSLink *link)
Adds the given car to the leading vehicles.
Definition MELoop.cpp:301
void clearState()
Remove all vehicles before quick-loading state.
Definition MELoop.cpp:308
void removeLeaderCar(MEVehicle *v)
Removes the given car from the leading vehicles.
Definition MELoop.cpp:315
LeaderEventQeue myLeaderCars
Definition MELoop.h:170
std::vector< MESegment * > myEdges2FirstSegments
mapping from internal edge ids to their initial segments
Definition MELoop.h:174
~MELoop()
Definition MELoop.cpp:51
std::priority_queue< LeaderEvent > LeaderEventQeue
leader cars in the segments sorted by exit time
Definition MELoop.h:169
void checkCar(MEVehicle *veh)
Check whether the vehicle may move.
Definition MELoop.cpp:186
void teleportVehicle(MEVehicle *veh, MESegment *const toSegment, bool disconnected)
teleports a vehicle or continues a teleport
Definition MELoop.cpp:238
static int numSegmentsFor(const double length, const double slength)
Compute number of segments per edge (best value stay close to the configured segment length)
Definition MELoop.cpp:354
void buildSegmentsFor(const MSEdge &e, const OptionsCont &oc)
Build the segments for a given edge.
Definition MELoop.cpp:365
A single mesoscopic segment (cell)
Definition MESegment.h:50
void addReminders(MEVehicle *veh) const
add this lanes MoveReminders to the given vehicle
static const int PARKING_QUEUE
Definition MESegment.h:53
void receive(MEVehicle *veh, const int qIdx, SUMOTime time, const bool isDepart=false, const bool isTeleport=false, const bool newEdge=false)
Adds the vehicle to the segment, adapting its parameters.
MSLink * getLink(const MEVehicle *veh, bool tlsPenalty=false) const
Returns the link the given car will use when passing the next junction.
double getLength() const
Returns the length of the segment in meters.
Definition MESegment.h:254
SUMOTime hasSpaceFor(const MEVehicle *const veh, const SUMOTime entryTime, int &qIdx, const bool init=false) const
Returns whether the given vehicle would still fit into the segment.
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
Definition MESegment.h:374
virtual void updateEntryBlockTime(SUMOTime)
update entry blockTime for all queues
Definition MESegment.h:199
virtual void send(MEVehicle *veh, MESegment *const next, const int nextQIdx, SUMOTime time, const MSMoveReminder::Notification reason)
Removes the vehicle from the segment, adapting its parameters.
SUMOTime getEventTime() const
Returns the (planned) time at which the next vehicle leaves this segment.
int getIndex() const
Returns the running index of the segment in the edge (0 is the most upstream).
Definition MESegment.h:238
static bool isInvalid(const MESegment *segment)
whether the given segment is 0 or encodes vaporization
Definition MESegment.h:457
MESegment * getNextSegment() const
Returns the following segment on the same edge (0 if it is the last).
Definition MESegment.h:246
A vehicle from the mesoscopic point of view.
Definition MEVehicle.h:42
bool mayProceed()
Returns whether the vehicle is allowed to pass the next junction, checks also for triggered stops.
void processStop()
ends the current stop and performs loading/unloading
SUMOTime getWaitingTime(const bool accumulated=false) const
Returns the duration for which the vehicle was blocked.
Definition MEVehicle.h:309
bool moveRoutePointer()
Update when the vehicle enters a new edge in the move step.
void updateDetectors(const SUMOTime currentTime, const SUMOTime exitTime, const bool isLeave, const MSMoveReminder::Notification reason=MSMoveReminder::NOTIFICATION_JUNCTION)
Updates all vehicle detectors.
SUMOTime getLastEntryTime() const
Returns the time the vehicle entered the current segment.
Definition MEVehicle.h:280
void setEventTime(SUMOTime t, bool hasDelay=true)
Sets the (planned) time at which the vehicle leaves its current segment.
Definition MEVehicle.h:206
void setApproaching(MSLink *link)
registers vehicle with the given link
bool endTriggeredStop()
process triggered stops and return true if all stops on the current segment are completed
MESegment * getSegment() const
Returns the current segment the vehicle is on.
Definition MEVehicle.h:249
int getQueIndex() const
Returns the index of the que the vehicle is in.
Definition MEVehicle.h:258
virtual void setSegment(MESegment *s, int idx=0)
Sets the current segment the vehicle is at together with its que.
Definition MEVehicle.h:240
SUMOTime getEventTime() const
Returns the (planned) time at which the vehicle leaves its current segment.
Definition MEVehicle.h:218
void setBlockTime(const SUMOTime t)
Sets the time at which the vehicle was blocked.
Definition MEVehicle.h:294
SUMOTime getBlockTime() const
Returns the time at which the vehicle was blocked.
Definition MEVehicle.h:303
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
bool isStoppedParking() const
Returns whether the vehicle is on a parking stop.
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
bool ignoreTransientPermissions() const
Returns whether this object is ignoring transient permission changes (during routing)
virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool isStopped() const
Returns whether the vehicle is at a stop.
A road/street connecting two junctions.
Definition MSEdge.h:77
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
Definition MSEdge.h:388
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition MSEdge.h:168
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Get the allowed lanes to reach the destination-edge.
Definition MSEdge.cpp:504
bool isNormal() const
return whether this edge is an internal edge
Definition MSEdge.h:264
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is returned; should pr...
Definition MSEdge.cpp:1216
double getLength() const
return the length of the edge
Definition MSEdge.h:694
int getNumericalID() const
Returns the numerical id of the edge.
Definition MSEdge.h:307
const std::string & getEdgeType() const
Returns the type of the edge.
Definition MSEdge.h:320
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal, SUMOVehicleClass vClass) const
Definition MSEdge.cpp:958
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition MSEdge.cpp:1323
static SUMOTime gTimeToTeleportDisconnected
Definition MSGlobals.h:66
static bool gCheckRoutes
Definition MSGlobals.h:91
static bool gRemoveGridlocked
Definition MSGlobals.h:75
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Definition MSGlobals.h:81
static SUMOTime gTimeToGridlock
Definition MSGlobals.h:57
Representation of a lane in the micro simulation.
Definition MSLane.h:84
Notification
Definition of a vehicle state.
@ NOTIFICATION_ARRIVED
The vehicle arrived at its destination (is deleted)
@ NOTIFICATION_TELEPORT_ARRIVED
The vehicle was teleported out of the net.
@ NOTIFICATION_SEGMENT
The vehicle changes the segment (meso only)
@ NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
@ NOTIFICATION_TELEPORT
The vehicle is being teleported.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition MSNet.cpp:201
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition MSNet.h:402
const MESegment::MesoEdgeType & getMesoType(const std::string &typeID)
Returns edge type specific meso parameters if no type specific parameters have been loaded,...
Definition MSNet.cpp:440
void registerTeleportJam()
register one non-collision-related teleport
void scheduleVehicleRemoval(SUMOVehicle *veh, bool checkDuplicate=false)
Removes a vehicle after it has ended.
const SUMOVTypeParameter & getParameter() const
const std::string & getID() const
Returns the id.
Definition Named.h:73
A storage for options typed value containers)
Definition OptionsCont.h:89
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
SUMOTime getTimeToTeleport(SUMOTime defaultValue) const
return time-to-teleport (either custom or default)
MEVehicle * veh
Definition MELoop.h:148
static long long int myEventCounter
Definition MELoop.h:161
LeaderEvent(MEVehicle *v)
Definition MELoop.cpp:421
edge type specific meso parameters
Definition MESegment.h:58