Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSDriveWay.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2002-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// A sequende of rail tracks (lanes) that may be used as a "set route" (Fahrstraße)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <utils/common/Named.h>
25#include <microsim/MSRoute.h>
26#include <microsim/MSLink.h>
27
28// ===========================================================================
29// class declarations
30// ===========================================================================
31class SUMOVehicle;
32class MSLane;
33class MSRailSignal;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
41class MSDriveWay : public MSMoveReminder, public Named {
42public:
43 typedef std::pair<const SUMOVehicle* const, const MSLink::ApproachingVehicleInformation> Approaching;
44 typedef std::set<const MSLane*, ComparatorNumericalIdLess> LaneSet;
45 typedef std::map<const MSLane*, int, ComparatorNumericalIdLess> LaneVisitedMap;
46
47 struct VehicleEvent {
48 VehicleEvent(SUMOTime _time, bool _isEntry, const std::string& _id, Notification _reason):
49 time(_time), isEntry(_isEntry), id(_id), reason(_reason) {}
51 bool isEntry;
52 std::string id;
54 };
55
56 /* The driveways (Fahrstrassen) for each link index of MSRailSignal
57 * Each link index has at least one driveway
58 * A driveway describes one possible route that passes the signal up to
59 * the next secure point
60 * When a signal guards a switch (indirect guard) that signal stores two
61 * or more driveways
62 */
63 MSDriveWay(const MSLink* origin, const std::string& id, bool temporary = false);
64
66 virtual ~MSDriveWay();
67
68 static void cleanup();
69
70 static void clearState();
71
72 static bool haveDriveWays() {
73 return myGlobalDriveWayIndex > 0;
74 }
75
76 static const MSDriveWay* retrieveDepartDriveWay(const MSEdge* edge, const std::string& id);
77
78 bool notifyEnter(SUMOTrafficObject& veh, Notification reason, const MSLane* enteredLane);
79 bool notifyLeave(SUMOTrafficObject& veh, double lastPos, Notification reason, const MSLane* enteredLane = 0);
80 bool notifyLeaveBack(SUMOTrafficObject& veh, Notification reason, const MSLane* leftLane);
82
84 bool flankConflict(const MSDriveWay& other) const;
85
87 bool crossingConflict(const MSDriveWay& other) const;
88
90 bool bidiBlockedBy(const MSDriveWay& other) const;
91
93 bool bidiBlockedByEnd(const MSDriveWay& other) const;
94
96 bool forwardRouteConflict(std::set<const MSEdge*> forward, const MSDriveWay& other, bool secondCheck = false);
97
99 bool conflictLaneOccupied(bool store = true, const SUMOVehicle* ego = nullptr) const;
100
102 bool foeDriveWayOccupied(bool store, const SUMOVehicle* ego, MSEdgeVector& occupied) const;
103
105 bool sidingDeadlock(const SUMOVehicle* veh) const;
106
108 bool foeDriveWayApproached() const;
109
111 bool reserve(const Approaching& closest, MSEdgeVector& occupied);
112
114 void writeBlocks(OutputDevice& od) const;
115 void writeBlockVehicles(OutputDevice& od) const;
116
117 const std::vector<const MSEdge*>& getRoute() const {
118 return myRoute;
119 }
120
121 const std::vector<const MSLane*>& getFlank() const {
122 return myFlank;
123 }
124
125 const std::vector<const MSLane*>& getBidi() const {
126 return myBidi;
127 }
128
129 const std::vector<MSLink*>& getConflictLinks() const {
130 return myConflictLinks;
131 }
132
133 int getNumericalID() const {
134 return myNumericalID;
135 }
136
137 const std::vector<VehicleEvent>& getEvents() const {
138 return myVehicleEvents;
139 }
140
141 void setEvents(const std::vector<VehicleEvent>& events) {
142 myVehicleEvents = events;
143 }
144
145 void setVehicle(const std::string& vehID) {
146 myFirstVehicle = vehID;
147 }
148
149 const std::string& getFirstVehicle() const {
150 return myFirstVehicle;
151 }
152
153 const std::vector<MSDriveWay*>& getFoes() const {
154 return myFoes;
155 }
156
157 const std::vector<const MSLane*>& getForward() const {
158 return myForward;
159 }
160
162 bool match(MSRouteIterator firstIt, MSRouteIterator endIt) const;
163
164 void addDWDeadlock(const std::vector<const MSDriveWay*>& deadlockFoes);
165
166 bool isDepartDriveway() const {
167 return myOrigin == nullptr;
168 };
169
170 const MSLink* getOrigin() const {
171 return myOrigin;
172 }
173
175 bool hasTrain(SUMOVehicle* veh) const;
176
177 const std::vector<MSDriveWay*>& getSubDriveWays() const {
178 return mySubDriveWays;
179 }
180
181 bool foundSignal() const {
182 return myFoundSignal;
183 }
184
185 bool isSubDriveWay() const {
186 return myParent != nullptr;
187 }
188
189 const MSDriveWay* getParent() const {
190 return myParent;
191 }
192
194 double getParentRemainingLength() const;
195
196 static void init();
197
198 static bool hasRS(const MSEdge* cur, const MSEdge* next);
199
201 static bool mustYield(const Approaching& veh, const Approaching& foe);
202
204 static MSDriveWay* buildDriveWay(const std::string& id, const MSLink* link, MSRouteIterator first, MSRouteIterator end);
205
207 static std::string getClickableTLLinkID(const MSLink* link);
208
209 static const MSDriveWay* getDepartureDriveway(const SUMOVehicle* veh, bool init = false);
210
211 static const std::vector<MSDriveWay*>& getEndingDriveWays(const MSEdge* edge);
212
213 static void writeDepatureBlocks(OutputDevice& od, bool writeVehicles);
214
216 static void saveState(OutputDevice& out);
217 static void loadState(const SUMOSAXAttributes& attrs, int tag);
218
219protected:
220
223
226
229
231 std::vector<const MSEdge*> myRoute;
232
235
238
249
250 /* @brief the actual driveway part up to the next railsignal (halting position)
251 * This must be free of other trains */
252 std::vector<const MSLane*> myForward;
253
254 /* @brief the list of bidirectional edges that can enter the forward
255 * section and which must also be free of traffic
256 * (up to the first element that could give protection) */
257 std::vector<const MSLane*> myBidi;
258
259 /* @brief the list of bidirectional edges that can enter the forward
260 * section and which might contain deadlock-relevant traffic */
261 std::vector<const MSLane*> myBidiExtended;
262 std::vector<const MSLane*> myBidiExtendedSorted;
263
264 /* @brief the list of edges that merge with the forward section
265 * (found via backward search, up to the first element that could give protection) */
266 std::vector<const MSLane*> myFlank;
267
269 std::vector<const MSLane*> myConflictLanes;
270
271 /* The conflict links for this block
272 * Conflict resolution must be performed if vehicles are approaching the
273 * current link and any of the conflict links */
274 std::vector<MSLink*> myConflictLinks;
275
277 bool hasLinkConflict(const Approaching& closest, const MSLink* foeLink) const;
278
280 bool overlap(const MSDriveWay& other) const;
281
282 /* @brief determine route that identifies this driveway (a subset of the
283 * vehicle route)
284 * collects:
285 * myRoute
286 * myForward
287 * myBidi
288 * myProtectedBidi
289 *
290 * returns edge that is assumed to safe from oncoming-deadlock or nullptr
291 */
292 void buildRoute(const MSLink* origin, MSRouteIterator next, MSRouteIterator end, LaneVisitedMap& visited, std::set<MSLink*, MSLink::ComparatorNumericalLaneIdLess>&);
293
294 /* @brief find switches that threaten this driveway
295 * @param[out] flankSwitches collect the switches
296 */
297 void checkFlanks(const MSLink* originLink, const std::vector<const MSLane*>& lanes, const LaneVisitedMap& visited,
298 bool allFoes, bool movingBlock, std::set<MSLink*, MSLink::ComparatorNumericalLaneIdLess>& flankSwitches) const;
299
300 /* @brief find links that cross the driveway without entering it
301 * @param[out] flankSwitches collect the switches
302 */
303 void checkCrossingFlanks(MSLink* dwLink, const LaneVisitedMap& visited, std::set<MSLink*, MSLink::ComparatorNumericalLaneIdLess>& flankSwitches) const;
304
305 /* @brief find upstream protection from the given link
306 * @param[out] flank: the stored flank lanes
307 */
308 void findFlankProtection(MSLink* link, MSLink* origLink, const std::vector<const MSLane*>& flank);
309
311 void addFoes(const MSLink* link);
312
314 void addSidings(MSDriveWay* foe, bool addToFoe = false);
315
317 void addBidiFoes(const MSRailSignal* ownSignal, bool extended);
318
320 void addParallelFoes(const MSLink* link, const MSEdge* first);
321
323 void addReversalFoes(bool movingBlock);
324
325 /* @brief build shortened driveway that ends where the foe train leaves the conflict zone of this driveway
326 * @return whether the foe has received a new entry in myFoes
327 */
328 bool buildSubFoe(MSDriveWay* foe, bool movingBlock);
329
331 void addConflictLink(const MSLink* link);
332
334 std::pair<bool, const MSDriveWay*> canUseSiding(const SUMOVehicle* ego, const MSDriveWay* foe, const MSEdge* recurseSidingEnd = nullptr) const;
335
337 const MSDriveWay* getFoeOrSubFoe(const MSDriveWay* dw) const;
338
339 bool forwardEndOnRoute(const MSDriveWay* foe) const;
340
341 void addSwitchFoes(MSLink* link);
342
343 bool haveSubTrains() const;
344
346 double getForwardDistance(int lastIndex) const;
347
348 /* @brief whether the train would have matched this driveway in it's past
349 * @return If matching, returns the number of edges the vehicle has gone past the start of the driveway,
350 * Indicate no-match by returning a negative value */
351 int matchesPastRoute(SUMOVehicle& sveh) const;
352
354 void enterDriveWay(SUMOVehicle& sveh, Notification reason);
355
356 static bool hasJoin(const SUMOVehicle* ego, const SUMOVehicle* foe);
357
358 static bool isSwitch(const MSLink* link);
359
360 void _saveState(OutputDevice& out) const;
361
363 static std::string getTLLinkID(const MSLink* link);
364
366 static std::string getJunctionLinkID(const MSLink* link);
367
369 static std::string formatVisitedMap(const LaneVisitedMap& visited);
370
372 static void appendMapIndex(LaneVisitedMap& map, const MSLane* lane);
373
374private:
375
376 struct Siding {
377 Siding(int s, int e, double l, std::vector<int> iEnds) : start(s), end(e), length(l), intermediateEnds(iEnds) {}
378 // indices along route
379 int start;
380 int end;
381 double length;
382 std::vector<int> intermediateEnds;
383 };
384
385 std::set<SUMOVehicle*, ComparatorNumericalIdLess> myTrains;
386
387 std::vector<VehicleEvent> myVehicleEvents;
388 std::vector<MSDriveWay*> myFoes;
389 std::map<const MSDriveWay*, std::vector<Siding>, ComparatorIdLess> mySidings;
390 std::vector<std::set <const MSDriveWay*> > myDeadlocks;
391
392 /* @brief shortened versions of this driveway to be used as foes instead of the long original
393 * (ends as soon as the train has left a particular conflict section)
394 * they are never attached to a LinkInfo and thus never the target of the match() function */
395 std::vector<MSDriveWay*> mySubDriveWays;
396
398 std::vector<const MSEdge*> myReversals;
399
401 std::string myFirstVehicle;
402
404 static bool myWriteVehicles;
405 static double myMovingBlockMaxDist;
406 static std::set<const MSEdge*> myBlockLengthWarnings;
407
409 static std::map<const MSLink*, std::vector<MSDriveWay*> > mySwitchDriveWays;
410
412 static std::map<const MSEdge*, std::vector<MSDriveWay*> > myReversalDriveWays;
413
415 static std::map<const MSEdge*, std::vector<MSDriveWay*>, ComparatorNumericalIdLess > myDepartureDriveways;
416 static std::map<const MSJunction*, int> myDepartDrivewayIndex;
418 static std::map<const MSEdge*, std::vector<MSDriveWay*> > myDepartureDrivewaysEnds;
419
421 static std::map<const MSEdge*, std::vector<MSDriveWay*>, ComparatorNumericalIdLess> myEndingDriveways;
423 static std::map<const MSEdge*, std::vector<std::pair<MSDriveWay*, MSDriveWay*> >, ComparatorNumericalIdLess> mySidingDriveways;
424 static std::vector<const MSEdge*> myCurrentSidingCheck;
425
427 static std::map<ConstMSEdgeVector, MSDriveWay*> myDriveWayRouteLookup;
428 static std::map<std::string, MSDriveWay*> myDriveWayLookup;
429 static const std::vector<MSDriveWay*> EMPTY_DRIVEWAY_VECTOR;
430
431};
long long int SUMOTime
Definition GUI.h:36
std::vector< MSEdge * > MSEdgeVector
Definition MSEdge.h:74
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition MSRoute.h:57
void addFoes(const MSLink *link)
add all driveWays that start at the given link as foes
std::vector< MSLink * > myConflictLinks
Definition MSDriveWay.h:274
const SUMOVehicle * myActive
whether the current signal is switched green for a train approaching this block
Definition MSDriveWay.h:228
bool crossingConflict(const MSDriveWay &other) const
Whether there is a crossing conflict with the given driveway.
static std::string getJunctionLinkID(const MSLink *link)
return junctionID_junctionLinkIndex
static void clearState()
bool haveSubTrains() const
std::vector< MSDriveWay * > mySubDriveWays
Definition MSDriveWay.h:395
std::vector< std::set< const MSDriveWay * > > myDeadlocks
Definition MSDriveWay.h:390
bool myAbortedBuild
whether driveway building was aborted due to MAX_BLOCK_LENGTH
Definition MSDriveWay.h:244
bool buildSubFoe(MSDriveWay *foe, bool movingBlock)
std::set< SUMOVehicle *, ComparatorNumericalIdLess > myTrains
Definition MSDriveWay.h:385
static std::map< const MSJunction *, int > myDepartDrivewayIndex
Definition MSDriveWay.h:416
std::vector< const MSLane * > myBidiExtendedSorted
Definition MSDriveWay.h:262
static const std::vector< MSDriveWay * > EMPTY_DRIVEWAY_VECTOR
Definition MSDriveWay.h:429
void buildRoute(const MSLink *origin, MSRouteIterator next, MSRouteIterator end, LaneVisitedMap &visited, std::set< MSLink *, MSLink::ComparatorNumericalLaneIdLess > &)
const MSDriveWay * getFoeOrSubFoe(const MSDriveWay *dw) const
return dw if it is a foe or a subDrivway of dw if it is a foe
static bool hasJoin(const SUMOVehicle *ego, const SUMOVehicle *foe)
bool isDepartDriveway() const
Definition MSDriveWay.h:166
static std::string getClickableTLLinkID(const MSLink *link)
return logicID_linkIndex in a way that allows clicking in sumo-gui
const MSLink * myOrigin
the link that enters this driveway or nullptr for a departure driveWay
Definition MSDriveWay.h:225
const std::string & getFirstVehicle() const
Definition MSDriveWay.h:149
bool myTerminateRoute
Definition MSDriveWay.h:242
static double myMovingBlockMaxDist
Definition MSDriveWay.h:405
std::vector< const MSLane * > myBidi
Definition MSDriveWay.h:257
static std::vector< const MSEdge * > myCurrentSidingCheck
Definition MSDriveWay.h:424
static bool myWriteVehicles
Definition MSDriveWay.h:404
bool notifyReroute(SUMOTrafficObject &veh)
Called if the vehicle change it's route.
bool hasLinkConflict(const Approaching &closest, const MSLink *foeLink) const
Whether the approaching vehicle is prevent from driving by another vehicle approaching the given link...
std::vector< const MSLane * > myBidiExtended
Definition MSDriveWay.h:261
static bool hasRS(const MSEdge *cur, const MSEdge *next)
void addBidiFoes(const MSRailSignal *ownSignal, bool extended)
derive foe driveways based on myBidi or myBidiExtended
static const MSDriveWay * retrieveDepartDriveWay(const MSEdge *edge, const std::string &id)
static bool haveDriveWays()
Definition MSDriveWay.h:72
static std::map< const MSEdge *, std::vector< std::pair< MSDriveWay *, MSDriveWay * > >, ComparatorNumericalIdLess > mySidingDriveways
all driveways that use a siding which ends on this edge as pair (dw, foe)
Definition MSDriveWay.h:423
void writeBlocks(OutputDevice &od) const
Write block items for this driveway.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, Notification reason, const MSLane *enteredLane=0)
Called if the vehicle leaves the reminder's lane.
bool sidingDeadlock(const SUMOVehicle *veh) const
whether insertion on this driveway would cause deadlock in an approached siding
std::vector< const MSLane * > myForward
Definition MSDriveWay.h:252
const std::vector< const MSLane * > & getBidi() const
Definition MSDriveWay.h:125
std::vector< const MSEdge * > myReversals
track own occurences in myReversalDriveWays for cleanup in destructor
Definition MSDriveWay.h:398
static const std::vector< MSDriveWay * > & getEndingDriveWays(const MSEdge *edge)
std::map< const MSDriveWay *, std::vector< Siding >, ComparatorIdLess > mySidings
Definition MSDriveWay.h:389
const std::vector< MSDriveWay * > & getSubDriveWays() const
Definition MSDriveWay.h:177
void writeBlockVehicles(OutputDevice &od) const
virtual ~MSDriveWay()
Destructor.
bool match(MSRouteIterator firstIt, MSRouteIterator endIt) const
whether the give route matches this driveway
static void appendMapIndex(LaneVisitedMap &map, const MSLane *lane)
append to map by map index and avoid undefined behavior
const MSDriveWay * getParent() const
Definition MSDriveWay.h:189
bool overlap(const MSDriveWay &other) const
Whether this driveway (route) overlaps with the given one.
void setEvents(const std::vector< VehicleEvent > &events)
Definition MSDriveWay.h:141
std::vector< const MSLane * > myFlank
Definition MSDriveWay.h:266
static std::string getTLLinkID(const MSLink *link)
return logicID_linkIndex
const std::vector< const MSLane * > & getForward() const
Definition MSDriveWay.h:157
bool foundSignal() const
Definition MSDriveWay.h:181
std::vector< const MSEdge * > myRoute
list of edges for matching against train routes
Definition MSDriveWay.h:231
std::map< const MSLane *, int, ComparatorNumericalIdLess > LaneVisitedMap
Definition MSDriveWay.h:45
static void writeDepatureBlocks(OutputDevice &od, bool writeVehicles)
static std::map< ConstMSEdgeVector, MSDriveWay * > myDriveWayRouteLookup
lookup table for state loading
Definition MSDriveWay.h:427
int getNumericalID() const
Definition MSDriveWay.h:133
static std::set< const MSEdge * > myBlockLengthWarnings
Definition MSDriveWay.h:406
static std::map< const MSEdge *, std::vector< MSDriveWay * > > myReversalDriveWays
all driveways reversing on the given switch (used to look up flank foes)
Definition MSDriveWay.h:412
static void init()
void _saveState(OutputDevice &out) const
static std::string formatVisitedMap(const LaneVisitedMap &visited)
print link descriptions
void checkFlanks(const MSLink *originLink, const std::vector< const MSLane * > &lanes, const LaneVisitedMap &visited, bool allFoes, bool movingBlock, std::set< MSLink *, MSLink::ComparatorNumericalLaneIdLess > &flankSwitches) const
static std::map< std::string, MSDriveWay * > myDriveWayLookup
Definition MSDriveWay.h:428
int matchesPastRoute(SUMOVehicle &sveh) const
const std::vector< MSLink * > & getConflictLinks() const
Definition MSDriveWay.h:129
void checkCrossingFlanks(MSLink *dwLink, const LaneVisitedMap &visited, std::set< MSLink *, MSLink::ComparatorNumericalLaneIdLess > &flankSwitches) const
const std::vector< MSDriveWay * > & getFoes() const
Definition MSDriveWay.h:153
const MSLink * getOrigin() const
Definition MSDriveWay.h:170
bool flankConflict(const MSDriveWay &other) const
Whether there is a flank conflict with the given driveway.
bool conflictLaneOccupied(bool store=true, const SUMOVehicle *ego=nullptr) const
whether any of myConflictLanes is occupied (vehicles that are the target of a join must be ignored)
void addSwitchFoes(MSLink *link)
bool hasTrain(SUMOVehicle *veh) const
whether the given train is on this driveway
static std::map< const MSEdge *, std::vector< MSDriveWay * > > myDepartureDrivewaysEnds
all driveways that do not start at a rail signal (and are only used at departure) by end edge
Definition MSDriveWay.h:418
int myCoreSize
number of edges in myRoute where overlap with other driveways is forbidden
Definition MSDriveWay.h:234
double getForwardDistance(int lastIndex) const
compute distance along the forward section up to lastIndex
std::pair< const SUMOVehicle *const, const MSLink::ApproachingVehicleInformation > Approaching
Definition MSDriveWay.h:43
void addConflictLink(const MSLink *link)
add symmetical conflict link for foes when building a new driveway
static void cleanup()
bool notifyLeaveBack(SUMOTrafficObject &veh, Notification reason, const MSLane *leftLane)
Called if the vehicle's back leaves the reminder's lane.
std::string myFirstVehicle
the first vehicle using this driveway
Definition MSDriveWay.h:401
int myNumericalID
global driveway index
Definition MSDriveWay.h:222
bool forwardEndOnRoute(const MSDriveWay *foe) const
bool myFoundJump
Definition MSDriveWay.h:241
static void saveState(OutputDevice &out)
Save driveway occupancy into the given stream.
MSDriveWay * myParent
set to parent driveway if this is a subDriveway, nullptr otherwise
Definition MSDriveWay.h:248
static std::map< const MSEdge *, std::vector< MSDriveWay * >, ComparatorNumericalIdLess > myDepartureDriveways
all driveways that do not start at a rail signal (and are only used at departure)
Definition MSDriveWay.h:415
void setVehicle(const std::string &vehID)
Definition MSDriveWay.h:145
bool myBidiEnded
whether driveway building was aborted when no further bidi edge was found
Definition MSDriveWay.h:246
static bool mustYield(const Approaching &veh, const Approaching &foe)
Whether veh must yield to the foe train.
void findFlankProtection(MSLink *link, MSLink *origLink, const std::vector< const MSLane * > &flank)
const std::vector< const MSEdge * > & getRoute() const
Definition MSDriveWay.h:117
void addSidings(MSDriveWay *foe, bool addToFoe=false)
add sidings for the given foe
void enterDriveWay(SUMOVehicle &sveh, Notification reason)
helper method for notifyEnter
bool bidiBlockedByEnd(const MSDriveWay &other) const
Whether there is a bidi conflict with the end of the given driveway.
static int myGlobalDriveWayIndex
Definition MSDriveWay.h:403
bool isSubDriveWay() const
Definition MSDriveWay.h:185
static MSDriveWay * buildDriveWay(const std::string &id, const MSLink *link, MSRouteIterator first, MSRouteIterator end)
construct a new driveway by searching along the given route until all block structures are found
bool myFoundSignal
whether this driveway ends its forward section with a rail signal (and thus comprises a full block)
Definition MSDriveWay.h:240
static std::map< const MSLink *, std::vector< MSDriveWay * > > mySwitchDriveWays
all driveways passing the given switch (used to look up flank foes)
Definition MSDriveWay.h:409
const std::vector< const MSLane * > & getFlank() const
Definition MSDriveWay.h:121
const std::vector< VehicleEvent > & getEvents() const
Definition MSDriveWay.h:137
void addReversalFoes(bool movingBlock)
derive foe driveways that enter the bidi section by reversing
int myForwardEdgeCount
number of normal edges in myForward
Definition MSDriveWay.h:237
void addDWDeadlock(const std::vector< const MSDriveWay * > &deadlockFoes)
static std::map< const MSEdge *, std::vector< MSDriveWay * >, ComparatorNumericalIdLess > myEndingDriveways
all driveways that end on the given edge
Definition MSDriveWay.h:421
bool foeDriveWayApproached() const
whether any of my Foes is being approached
static void loadState(const SUMOSAXAttributes &attrs, int tag)
bool forwardRouteConflict(std::set< const MSEdge * > forward, const MSDriveWay &other, bool secondCheck=false)
Whether the route of other passes into the forward section of this driveway.
std::vector< const MSLane * > myConflictLanes
the lanes that must be clear of trains before this signal can switch to green
Definition MSDriveWay.h:269
static const MSDriveWay * getDepartureDriveway(const SUMOVehicle *veh, bool init=false)
std::vector< MSDriveWay * > myFoes
Definition MSDriveWay.h:388
std::vector< VehicleEvent > myVehicleEvents
Definition MSDriveWay.h:387
std::set< const MSLane *, ComparatorNumericalIdLess > LaneSet
Definition MSDriveWay.h:44
static bool isSwitch(const MSLink *link)
bool notifyEnter(SUMOTrafficObject &veh, Notification reason, const MSLane *enteredLane)
Checks whether the reminder is activated by a vehicle entering the lane.
bool bidiBlockedBy(const MSDriveWay &other) const
Whether there is a bidi conflict with the given driveway.
bool reserve(const Approaching &closest, MSEdgeVector &occupied)
attempt reserve this driveway for the given vehicle
std::pair< bool, const MSDriveWay * > canUseSiding(const SUMOVehicle *ego, const MSDriveWay *foe, const MSEdge *recurseSidingEnd=nullptr) const
return whether a siding can be used. If a siding exist but is occupied, also return the occupied driv...
void addParallelFoes(const MSLink *link, const MSEdge *first)
derive foe driveways that start at the same signal
bool foeDriveWayOccupied(bool store, const SUMOVehicle *ego, MSEdgeVector &occupied) const
whether any of myFoes is occupied (vehicles that are the target of a join must be ignored)
double getParentRemainingLength() const
return for how much longer the parent driveway continues after the end of this subdriveway
A road/street connecting two junctions.
Definition MSEdge.h:78
Representation of a lane in the micro simulation.
Definition MSLane.h:84
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
A signal for rails.
Base class for objects which have an id.
Definition Named.h:53
Static storage of an output device and its base (abstract) implementation.
Encapsulated SAX-Attributes.
Representation of a vehicle, person, or container.
Representation of a vehicle.
Definition SUMOVehicle.h:63
Function-object for stable sorting of objects acting like Named without being derived (SUMOVehicle)
Definition Named.h:29
Function-object for stable sorting of objects with numerical ids.
Definition Named.h:38
Siding(int s, int e, double l, std::vector< int > iEnds)
Definition MSDriveWay.h:377
std::vector< int > intermediateEnds
Definition MSDriveWay.h:382
VehicleEvent(SUMOTime _time, bool _isEntry, const std::string &_id, Notification _reason)
Definition MSDriveWay.h:48