Eclipse SUMO - Simulation of Urban MObility
NLJunctionControlBuilder.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // Builder of microsim-junctions and tls
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <map>
28 #include <string>
29 #include <vector>
30 #include <list>
31 #include <algorithm>
52 #include <microsim/MSGlobals.h>
53 #include <microsim/MSNet.h>
58 #include <utils/common/ToString.h>
59 #include <netbuild/NBNode.h>
60 #include "NLBuilder.h"
62 
63 
64 // ===========================================================================
65 // static members
66 // ===========================================================================
68 
69 // ===========================================================================
70 // method definitions
71 // ===========================================================================
73  myNet(net),
74  myDetectorBuilder(db),
75  myOffset(0),
76  myJunctions(nullptr),
77  myNetIsLoaded(false) {
80 }
81 
82 
84  delete myLogicControl;
85  delete myJunctions;
86 }
87 
88 
89 void
91  const std::string& key,
92  const SumoXMLNodeType type,
93  const Position pos,
94  const PositionVector& shape,
95  const std::vector<MSLane*>& incomingLanes,
96  const std::vector<MSLane*>& internalLanes) {
97  myActiveInternalLanes = internalLanes;
98  myActiveIncomingLanes = incomingLanes;
99  myActiveID = id;
100  myActiveKey = key;
101  myType = type;
102  myPosition.set(pos);
103  myShape = shape;
104  myAdditionalParameter.clear();
105 }
106 
107 
108 void
109 NLJunctionControlBuilder::closeJunction(const std::string& basePath) {
110  if (myJunctions == nullptr) {
111  throw ProcessError("Information about the number of nodes was missing.");
112  }
113  MSJunction* junction = nullptr;
114  switch (myType) {
115  case NODETYPE_NOJUNCTION:
116  case NODETYPE_DEAD_END:
118  case NODETYPE_DISTRICT:
120  junction = buildNoLogicJunction();
121  break;
125  case NODETYPE_PRIORITY:
128  case NODETYPE_ZIPPER:
129  junction = buildLogicJunction();
130  break;
131  case NODETYPE_INTERNAL:
133  junction = buildInternalJunction();
134  }
135  break;
138  myOffset = 0;
140  myActiveProgram = "0";
142  closeTrafficLightLogic(basePath);
143  junction = buildLogicJunction();
144  break;
145  default:
146  throw InvalidArgument("False junction logic type.");
147  }
148  if (junction != nullptr) {
149  if (!myJunctions->add(myActiveID, junction)) {
150  throw InvalidArgument("Another junction with the id '" + myActiveID + "' exists.");
151  }
152  }
154 }
155 
156 
160  myJunctions = nullptr;
161  return js;
162 }
163 
164 
165 MSJunction*
169 }
170 
171 
172 MSJunction*
175  // build the junction
178  jtype);
179 }
180 
181 
182 MSJunction*
184  // build the junction
187 }
188 
189 
192  // get and check the junction logic
193  if (myLogics.find(myActiveID) == myLogics.end()) {
194  throw InvalidArgument("Missing junction logic '" + myActiveID + "'.");
195  }
196  return myLogics[myActiveID];
197 }
198 
199 
201 NLJunctionControlBuilder::getTLLogic(const std::string& id) const {
202  return getTLLogicControlToUse().get(id);
203 }
204 
205 
206 void
208  if (myActiveProgram == "off") {
209  if (myAbsDuration > 0) {
210  throw InvalidArgument("The off program for TLS '" + myActiveKey + "' has phases.");
211  }
214  throw InvalidArgument("Another logic with id '" + myActiveKey + "' and programID '" + myActiveProgram + "' exists.");
215  }
216  return;
217  }
218  SUMOTime firstEventOffset = 0;
219  int step = 0;
220  MSTrafficLightLogic* existing = nullptr;
221  MSSimpleTrafficLightLogic::Phases::const_iterator i = myActivePhases.begin();
223  if (myAbsDuration == 0) {
225  if (existing == nullptr) {
226  throw InvalidArgument("TLS program '" + myActiveProgram + "' for TLS '" + myActiveKey + "' has a duration of 0.");
227  } else {
228  // only modify the offset of an existing logic
229  myAbsDuration = existing->getDefaultCycleTime();
230  i = existing->getPhases().begin();
231  }
232  }
233  // compute the initial step and first switch time of the tls-logic
234  // a positive offset delays all phases by x (advance by absDuration - x) while a negative offset advances all phases by x seconds
235  // @note The implementation of % for negative values is implementation defined in ISO1998
236  SUMOTime offset; // the time to run the traffic light in advance
237  if (myOffset >= 0) {
239  } else {
241  }
242  while (offset >= (*i)->duration) {
243  step++;
244  offset -= (*i)->duration;
245  ++i;
246  }
247  firstEventOffset = (*i)->duration - offset + myNet.getCurrentTimeStep();
248  if (existing != nullptr) {
250  myNet.getCurrentTimeStep(), step, (*i)->duration - offset);
251  return;
252  }
253  }
254 
255  if (myActiveProgram == "") {
256  myActiveProgram = "default";
257  }
258  MSTrafficLightLogic* tlLogic = nullptr;
259  // build the tls-logic in dependance to its type
260  switch (myLogicType) {
261  case TLTYPE_SWARM_BASED:
262  firstEventOffset = DELTA_T; //this is needed because swarm needs to update the pheromone on the lanes at every step
264  break;
267  break;
268  case TLTYPE_SOTL_REQUEST:
270  break;
271  case TLTYPE_SOTL_PLATOON:
273  break;
274  case TLTYPE_SOTL_WAVE:
276  break;
277  case TLTYPE_SOTL_PHASE:
279  break;
282  break;
283  case TLTYPE_ACTUATED:
284  // @note it is unclear how to apply the given offset in the context
285  // of variable-length phases
288  myActivePhases, step, (*i)->minDuration + myNet.getCurrentTimeStep(),
289  myAdditionalParameter, basePath);
290  break;
291  case TLTYPE_DELAYBASED:
294  myActivePhases, step, (*i)->minDuration + myNet.getCurrentTimeStep(),
295  myAdditionalParameter, basePath);
296  break;
297  case TLTYPE_STATIC:
300  myActivePhases, step, firstEventOffset,
302  break;
303  case TLTYPE_RAIL_SIGNAL:
304  tlLogic = new MSRailSignal(getTLLogicControlToUse(),
307  break;
309  tlLogic = new MSRailCrossing(getTLLogicControlToUse(),
312  break;
313  case TLTYPE_OFF:
315  break;
316  case TLTYPE_INVALID:
317  throw ProcessError("Invalid traffic light type '" + toString(myLogicType) + "'");
318  }
319  myActivePhases.clear();
320  if (tlLogic != nullptr) {
321  if (getTLLogicControlToUse().add(myActiveKey, myActiveProgram, tlLogic)) {
322  if (myNetIsLoaded) {
323  tlLogic->init(myDetectorBuilder);
324  } else {
325  myLogics2PostLoadInit.push_back(tlLogic);
326  }
327  } else {
328  WRITE_ERROR("Another logic with id '" + myActiveKey + "' and programID '" + myActiveProgram + "' exists.");
329  delete tlLogic;
330  }
331  }
332 }
333 
334 
335 void
337  myActiveKey = id;
338  myActiveProgram = "";
339  myActiveLogic.clear();
340  myActiveFoes.clear();
341  myActiveConts.reset();
342  myRequestSize = NO_REQUEST_SIZE; // seems not to be used
344  myCurrentHasError = false;
345 }
346 
347 
348 void
350  const std::string& response,
351  const std::string& foes,
352  bool cont) {
353  if (myCurrentHasError) {
354  // had an error
355  return;
356  }
357  if (request >= SUMO_MAX_CONNECTIONS) {
358  // bad request
359  myCurrentHasError = true;
360  throw InvalidArgument("Junction logic '" + myActiveKey + "' is larger than allowed; recheck the network.");
361  }
363  // initialize
364  myRequestSize = (int)response.size();
365  }
366  if (static_cast<int>(response.size()) != myRequestSize) {
367  myCurrentHasError = true;
368  throw InvalidArgument("Invalid response size " + toString(response.size()) +
369  " in Junction logic '" + myActiveKey + "' (expected " + toString(myRequestSize) + ")");
370  }
371  if (static_cast<int>(foes.size()) != myRequestSize) {
372  myCurrentHasError = true;
373  throw InvalidArgument("Invalid foes size " + toString(foes.size()) +
374  " in Junction logic '" + myActiveKey + "' (expected " + toString(myRequestSize) + ")");
375  }
376  // assert that the logicitems come ordered by their request index
377  assert((int)myActiveLogic.size() == request);
378  assert((int)myActiveFoes.size() == request);
379  // add the read response for the given request index
380  myActiveLogic.push_back(std::bitset<SUMO_MAX_CONNECTIONS>(response));
381  // add the read junction-internal foes for the given request index
382  myActiveFoes.push_back(std::bitset<SUMO_MAX_CONNECTIONS>(foes));
383  // add whether the vehicle may drive a little bit further
384  myActiveConts.set(request, cont);
385  // increse number of set information
387 }
388 
389 
390 void
391 NLJunctionControlBuilder::initTrafficLightLogic(const std::string& id, const std::string& programID,
392  TrafficLightType type, SUMOTime offset) {
393  myActiveKey = id;
394  myActiveProgram = programID;
395  myActivePhases.clear();
396  myAbsDuration = 0;
398  myLogicType = type;
399  myOffset = offset;
400  myAdditionalParameter.clear();
401 }
402 
403 
404 void
405 NLJunctionControlBuilder::addPhase(SUMOTime duration, const std::string& state, const std::vector<int>& nextPhases, SUMOTime minDuration, SUMOTime maxDuration, const std::string& name, bool transient_notdecisional, bool commit, MSPhaseDefinition::LaneIdVector* targetLanes) {
406  // build and add the phase definition to the list
407  myActivePhases.push_back(new MSPhaseDefinition(duration, state, minDuration, maxDuration, nextPhases, name, transient_notdecisional, commit, targetLanes));
408  // add phase duration to the absolute duration
409  myAbsDuration += duration;
410 }
411 
412 
413 void
414 NLJunctionControlBuilder::addPhase(SUMOTime duration, const std::string& state, const std::vector<int>& nextPhases,
415  SUMOTime minDuration, SUMOTime maxDuration, const std::string& name) {
416  // build and add the phase definition to the list
417  myActivePhases.push_back(new MSPhaseDefinition(duration, state, minDuration, maxDuration, nextPhases, name));
418  // add phase duration to the absolute duration
419  myAbsDuration += duration;
420 }
421 
422 
423 void
426  // We have a legacy network. junction element did not contain logicitems; read the logic later
427  return;
428  }
429  if (myCurrentHasError) {
430  // had an error before...
431  return;
432  }
434  throw InvalidArgument("The description for the junction logic '" + myActiveKey + "' is malicious.");
435  }
436  if (myLogics.count(myActiveKey) > 0) {
437  throw InvalidArgument("Junction logic '" + myActiveKey + "' was defined twice.");
438  }
442  myActiveConts);
443  myLogics[myActiveKey] = logic;
444 }
445 
446 
449  postLoadInitialization(); // must happen after edgeBuilder is finished
451  throw ProcessError("Traffic lights could not be built.");
452  }
454  myLogicControl = nullptr;
455  return ret;
456 }
457 
458 
459 void
460 NLJunctionControlBuilder::addParam(const std::string& key,
461  const std::string& value) {
462  myAdditionalParameter[key] = value;
463 }
464 
465 
468  if (myLogicControl != nullptr) {
469  return *myLogicControl;
470  }
471  return myNet.getTLSControl();
472 }
473 
474 
475 const std::string&
477  return myActiveKey;
478 }
479 
480 
481 const std::string&
483  return myActiveProgram;
484 }
485 
486 
487 void
489  for (MSTrafficLightLogic* const logic : myLogics2PostLoadInit) {
490  logic->init(myDetectorBuilder);
491  }
492  myNetIsLoaded = true;
493 }
494 
495 
496 MSJunction*
497 NLJunctionControlBuilder::retrieve(const std::string id) {
498  if (myJunctions != nullptr) {
499  return myJunctions->get(id);
500  } else {
501  return nullptr;
502  }
503 }
504 
505 /****************************************************************************/
NLJunctionControlBuilder::~NLJunctionControlBuilder
virtual ~NLJunctionControlBuilder()
Destructor.
Definition: NLJunctionControlBuilder.cpp:83
NLJunctionControlBuilder::initTrafficLightLogic
void initTrafficLightLogic(const std::string &id, const std::string &programID, TrafficLightType type, SUMOTime offset)
Begins the reading of a traffic lights logic.
Definition: NLJunctionControlBuilder.cpp:391
TLTYPE_SOTL_PLATOON
Definition: SUMOXMLDefinitions.h:1199
MSRightOfWayJunction.h
NODETYPE_PRIORITY
Definition: SUMOXMLDefinitions.h:1056
NLJunctionControlBuilder::myDetectorBuilder
NLDetectorBuilder & myDetectorBuilder
The detector builder to use.
Definition: NLJunctionControlBuilder.h:333
Parameterised::updateParameter
void updateParameter(const std::map< std::string, std::string > &mapArg)
Adds or updates all given parameters from the map.
Definition: Parameterised.cpp:57
NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED
Definition: SUMOXMLDefinitions.h:1053
TLTYPE_SOTL_MARCHING
Definition: SUMOXMLDefinitions.h:1202
MSTrafficLightLogic::getPhases
virtual const Phases & getPhases() const =0
Returns the phases of this tls program.
TLTYPE_SWARM_BASED
Definition: SUMOXMLDefinitions.h:1203
ToString.h
NLJunctionControlBuilder::myActiveConts
std::bitset< SUMO_MAX_CONNECTIONS > myActiveConts
The description about which lanes have an internal follower.
Definition: NLJunctionControlBuilder.h:348
NODETYPE_ZIPPER
Definition: SUMOXMLDefinitions.h:1060
NLJunctionControlBuilder::postLoadInitialization
void postLoadInitialization()
initialize junctions after all connections have been loaded
Definition: NLJunctionControlBuilder.cpp:488
MSNoLogicJunction
Definition: MSNoLogicJunction.h:49
MSTLLogicControl.h
NODETYPE_DEAD_END_DEPRECATED
Definition: SUMOXMLDefinitions.h:1065
MSNet.h
MSSOTLMarchingPolicy
Class for low-level marching policy.
Definition: MSSOTLMarchingPolicy.h:34
MSSOTLPlatoonPolicy.h
MSJunction
The base class for an intersection.
Definition: MSJunction.h:61
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:35
NLBuilder.h
MSDeterministicHiLevelTrafficLightLogic
Definition: MSDeterministicHiLevelTrafficLightLogic.h:34
NLJunctionControlBuilder::myActiveInternalLanes
LaneVector myActiveInternalLanes
The list of the internal lanes of the currently chosen junction.
Definition: NLJunctionControlBuilder.h:366
TLTYPE_STATIC
Definition: SUMOXMLDefinitions.h:1193
TLTYPE_INVALID
Definition: SUMOXMLDefinitions.h:1206
MSJunctionLogic.h
MSSOTLWaveTrafficLightLogic
Definition: MSSOTLWaveTrafficLightLogic.h:27
NLJunctionControlBuilder::myActiveLogic
MSBitsetLogic::Logic myActiveLogic
The right-of-way-logic of the currently chosen bitset-logic.
Definition: NLJunctionControlBuilder.h:342
MSOffTrafficLightLogic.h
NLJunctionControlBuilder::myActiveKey
std::string myActiveKey
The key of the currently chosen junction.
Definition: NLJunctionControlBuilder.h:372
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:92
NLJunctionControlBuilder::myActiveProgram
std::string myActiveProgram
Definition: NLJunctionControlBuilder.h:372
NLJunctionControlBuilder::closeJunctionLogic
void closeJunctionLogic()
Ends the building of a junction logic (row-logic)
Definition: NLJunctionControlBuilder.cpp:424
NLJunctionControlBuilder::NO_REQUEST_SIZE
static const int NO_REQUEST_SIZE
Definition: NLJunctionControlBuilder.h:416
NLJunctionControlBuilder::buildInternalJunction
virtual MSJunction * buildInternalJunction()
Builds an internal junction.
Definition: NLJunctionControlBuilder.cpp:183
MSSwarmTrafficLightLogic
Definition: MSSwarmTrafficLightLogic.h:101
MSBitSetLogic::Foes
std::vector< std::bitset< N > > Foes
Container holding the information which internal lanes prohibt which links Build the same way as Logi...
Definition: MSBitSetLogic.h:56
TrafficLightType
TrafficLightType
Definition: SUMOXMLDefinitions.h:1192
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
NODETYPE_INTERNAL
Definition: SUMOXMLDefinitions.h:1063
NLJunctionControlBuilder::myAbsDuration
SUMOTime myAbsDuration
The absolute duration of a tls-control loop.
Definition: NLJunctionControlBuilder.h:381
NLJunctionControlBuilder::myNet
MSNet & myNet
The net to use.
Definition: NLJunctionControlBuilder.h:330
MSSOTLRequestPolicy.h
MSJunctionControl.h
MSInternalJunction
Definition: MSInternalJunction.h:52
MSPhaseDefinition::LaneIdVector
std::vector< std::string > LaneIdVector
Definition: MSPhaseDefinition.h:67
MSInternalJunction.h
TLTYPE_RAIL_SIGNAL
Definition: SUMOXMLDefinitions.h:1194
PositionVector
A list of positions.
Definition: PositionVector.h:46
NLJunctionControlBuilder::getActiveSubKey
const std::string & getActiveSubKey() const
Returns the active sub key.
Definition: NLJunctionControlBuilder.cpp:482
MSSimpleTrafficLightLogic.h
NLJunctionControlBuilder::myShape
PositionVector myShape
The shape of the current junction.
Definition: NLJunctionControlBuilder.h:384
NLJunctionControlBuilder::closeJunction
void closeJunction(const std::string &basePath)
Closes (ends) the processing of the current junction.
Definition: NLJunctionControlBuilder.cpp:109
MSSOTLPolicyBasedTrafficLightLogic
A self-organizing traffic light logic based on a particular policy.
Definition: MSSOTLPolicyBasedTrafficLightLogic.h:41
NLJunctionControlBuilder::myPosition
Position myPosition
The position of the junction.
Definition: NLJunctionControlBuilder.h:378
MSTrafficLightLogic.h
NLJunctionControlBuilder::myOffset
SUMOTime myOffset
The switch offset within the tls.
Definition: NLJunctionControlBuilder.h:336
MSJunctionControl
Container for junctions; performs operations on all stored junctions.
Definition: MSJunctionControl.h:45
TLTYPE_SOTL_WAVE
Definition: SUMOXMLDefinitions.h:1201
NODETYPE_ALLWAY_STOP
Definition: SUMOXMLDefinitions.h:1059
NODETYPE_RAIL_SIGNAL
Definition: SUMOXMLDefinitions.h:1054
NLJunctionControlBuilder::getTLLogic
MSTLLogicControl::TLSLogicVariants & getTLLogic(const std::string &id) const
Returns a previously build tls logic.
Definition: NLJunctionControlBuilder.cpp:201
MSJunctionLogic
Definition: MSJunctionLogic.h:39
MSSOTLWaveTrafficLightLogic.h
MSTrafficLightLogic::changeStepAndDuration
virtual void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, int step, SUMOTime stepDuration)=0
Changes the current phase and her duration.
MSTLLogicControl::get
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
Definition: MSTLLogicControl.cpp:584
NLJunctionControlBuilder::myJunctions
MSJunctionControl * myJunctions
The junctions controls.
Definition: NLJunctionControlBuilder.h:360
NLJunctionControlBuilder::myActiveID
std::string myActiveID
The id of the currently chosen junction.
Definition: NLJunctionControlBuilder.h:369
NODETYPE_PRIORITY_STOP
Definition: SUMOXMLDefinitions.h:1057
NODETYPE_TRAFFIC_LIGHT_NOJUNCTION
Definition: SUMOXMLDefinitions.h:1052
NLJunctionControlBuilder::myActivePhases
MSSimpleTrafficLightLogic::Phases myActivePhases
The current phase definitions for a simple traffic light.
Definition: NLJunctionControlBuilder.h:351
MSBitSetLogic::Logic
std::vector< std::bitset< N > > Logic
Container that holds the right of way bitsets. Each link has it's own bitset. The bits in the bitsets...
Definition: MSBitSetLogic.h:52
NLJunctionControlBuilder::buildLogicJunction
virtual MSJunction * buildLogicJunction()
Builds a junction with a logic.
Definition: NLJunctionControlBuilder.cpp:173
NLJunctionControlBuilder::myLogicType
TrafficLightType myLogicType
The current logic type.
Definition: NLJunctionControlBuilder.h:339
NLJunctionControlBuilder::closeTrafficLightLogic
virtual void closeTrafficLightLogic(const std::string &basePath)
Ends the building of a traffic lights logic.
Definition: NLJunctionControlBuilder.cpp:207
SumoXMLNodeType
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
Definition: SUMOXMLDefinitions.h:1049
Position::set
void set(double x, double y)
set positions x and y
Definition: Position.h:87
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:284
MSRailSignal
A signal for rails.
Definition: MSRailSignal.h:47
NLJunctionControlBuilder::openJunction
void openJunction(const std::string &id, const std::string &key, const SumoXMLNodeType type, const Position pos, const PositionVector &shape, const std::vector< MSLane * > &incomingLanes, const std::vector< MSLane * > &internalLanes)
Begins the processing of the named junction.
Definition: NLJunctionControlBuilder.cpp:90
MSTrafficLightLogic::getDefaultCycleTime
SUMOTime getDefaultCycleTime() const
Returns the cycle time (in ms)
Definition: MSTrafficLightLogic.h:268
MSRailCrossing.h
NLJunctionControlBuilder::myLogics
std::map< std::string, MSJunctionLogic * > myLogics
Map of loaded junction logics.
Definition: NLJunctionControlBuilder.h:403
ProcessError
Definition: UtilExceptions.h:40
MSOffTrafficLightLogic
A traffic lights logic which represents a tls in an off-mode.
Definition: MSOffTrafficLightLogic.h:43
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
MSSimpleTrafficLightLogic
A fixed traffic light logic.
Definition: MSSimpleTrafficLightLogic.h:55
MSDeterministicHiLevelTrafficLightLogic.h
NLJunctionControlBuilder::myRequestSize
int myRequestSize
The size of the request.
Definition: NLJunctionControlBuilder.h:354
NLJunctionControlBuilder::retrieve
MSJunction * retrieve(const std::string id)
try to retrieve junction by id
Definition: NLJunctionControlBuilder.cpp:497
NLJunctionControlBuilder::myNetIsLoaded
bool myNetIsLoaded
whether the network has been loaded
Definition: NLJunctionControlBuilder.h:419
MSGlobals.h
UtilExceptions.h
MSNoLogicJunction.h
MSActuatedTrafficLightLogic
An actuated (adaptive) traffic light logic.
Definition: MSActuatedTrafficLightLogic.h:51
NLJunctionControlBuilder::addParam
void addParam(const std::string &key, const std::string &value)
Adds a parameter.
Definition: NLJunctionControlBuilder.cpp:460
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:56
MSDelayBasedTrafficLightLogic.h
TLTYPE_SOTL_PHASE
Definition: SUMOXMLDefinitions.h:1198
NLJunctionControlBuilder::myRequestItemNumber
int myRequestItemNumber
Counter for the inserted items.
Definition: NLJunctionControlBuilder.h:357
MSSOTLRequestPolicy
Class for low-level request policy.
Definition: MSSOTLRequestPolicy.h:33
NODETYPE_RAIL_CROSSING
Definition: SUMOXMLDefinitions.h:1055
NODETYPE_RIGHT_BEFORE_LEFT
Definition: SUMOXMLDefinitions.h:1058
MSRightOfWayJunction
A junction with right-of-way - rules.
Definition: MSRightOfWayJunction.h:52
NODETYPE_DEAD_END
Definition: SUMOXMLDefinitions.h:1064
NLJunctionControlBuilder::NLJunctionControlBuilder
NLJunctionControlBuilder(MSNet &net, NLDetectorBuilder &db)
Constructor.
Definition: NLJunctionControlBuilder.cpp:72
NLJunctionControlBuilder::getTLLogicControlToUse
MSTLLogicControl & getTLLogicControlToUse() const
Returns the used tls control.
Definition: NLJunctionControlBuilder.cpp:467
NLJunctionControlBuilder::myCurrentHasError
bool myCurrentHasError
Information whether the current logic had an error.
Definition: NLJunctionControlBuilder.h:406
NODETYPE_DISTRICT
Definition: SUMOXMLDefinitions.h:1061
NLJunctionControlBuilder::myActiveFoes
MSBitsetLogic::Foes myActiveFoes
The description about which lanes disallow other passing the junction simultaneously.
Definition: NLJunctionControlBuilder.h:345
MSGlobals::gUsingInternalLanes
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Definition: MSGlobals.h:69
MSSwarmTrafficLightLogic.h
MSNet::getTLSControl
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Definition: MSNet.h:410
NLJunctionControlBuilder::buildNoLogicJunction
virtual MSJunction * buildNoLogicJunction()
Builds a junction that does not use a logic.
Definition: NLJunctionControlBuilder.cpp:166
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
TLTYPE_RAIL_CROSSING
Definition: SUMOXMLDefinitions.h:1195
MSRailCrossing
A signal for rails.
Definition: MSRailCrossing.h:39
NLJunctionControlBuilder::myType
SumoXMLNodeType myType
The type of the currently chosen junction.
Definition: NLJunctionControlBuilder.h:375
MSSOTLPhasePolicy
Class for low-level phase policy.
Definition: MSSOTLPhasePolicy.h:34
MSBitsetLogic
MSBitSetLogic< SUMO_MAX_CONNECTIONS > MSBitsetLogic
Definition: MSBitSetLogic.h:121
NLJunctionControlBuilder::myAdditionalParameter
StringParameterMap myAdditionalParameter
Parameter map (key->value)
Definition: NLJunctionControlBuilder.h:399
TLTYPE_DELAYBASED
Definition: SUMOXMLDefinitions.h:1197
InvalidArgument
Definition: UtilExceptions.h:57
SUMO_MAX_CONNECTIONS
#define SUMO_MAX_CONNECTIONS
the maximum number of connections across an intersection
Definition: StdDefs.h:43
NLJunctionControlBuilder::myActiveIncomingLanes
LaneVector myActiveIncomingLanes
The list of the incoming lanes of the currently chosen junction.
Definition: NLJunctionControlBuilder.h:363
NLJunctionControlBuilder::addPhase
void addPhase(SUMOTime duration, const std::string &state, const std::vector< int > &nextPhases, SUMOTime min, SUMOTime max, const std::string &name)
Adds a phase to the currently built traffic lights logic.
Definition: NLJunctionControlBuilder.cpp:414
NamedObjectCont::get
T get(const std::string &id) const
Retrieves an item.
Definition: NamedObjectCont.h:99
MSSOTLMarchingPolicy.h
MSDelayBasedTrafficLightLogic
An actuated traffic light logic based on time delay of approaching vehicles.
Definition: MSDelayBasedTrafficLightLogic.h:47
NLJunctionControlBuilder::myLogicControl
MSTLLogicControl * myLogicControl
The tls control to use (0 if net's tls control shall be used)
Definition: NLJunctionControlBuilder.h:392
NLJunctionControlBuilder::initJunctionLogic
void initJunctionLogic(const std::string &id)
Initialises a junction logic.
Definition: NLJunctionControlBuilder.cpp:336
MSTLLogicControl::TLSLogicVariants
Storage for all programs of a single tls.
Definition: MSTLLogicControl.h:86
NLJunctionControlBuilder.h
NLJunctionControlBuilder::myLogics2PostLoadInit
std::vector< MSTrafficLightLogic * > myLogics2PostLoadInit
The container for information which junctions shall be initialised using which values.
Definition: NLJunctionControlBuilder.h:388
config.h
TLTYPE_OFF
Definition: SUMOXMLDefinitions.h:1205
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:60
MSSOTLPlatoonPolicy
Class for low-level platoon policy.
Definition: MSSOTLPlatoonPolicy.h:36
MSSOTLPhasePolicy.h
NLJunctionControlBuilder::getJunctionLogicSecure
MSJunctionLogic * getJunctionLogicSecure()
Returns the current junction logic.
Definition: NLJunctionControlBuilder.cpp:191
MSEventControl.h
MSPhaseDefinition
The definition of a single phase of a tls logic.
Definition: MSPhaseDefinition.h:52
TLTYPE_HILVL_DETERMINISTIC
Definition: SUMOXMLDefinitions.h:1204
MSTrafficLightLogic::init
virtual void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
Definition: MSTrafficLightLogic.cpp:115
MSSOTLPolicyBasedTrafficLightLogic.h
NLJunctionControlBuilder::build
MSJunctionControl * build() const
Builds the MSJunctionControl which holds all of the simulations junctions.
Definition: NLJunctionControlBuilder.cpp:158
TLTYPE_SOTL_REQUEST
Definition: SUMOXMLDefinitions.h:1200
NBNode.h
NLJunctionControlBuilder::buildTLLogics
MSTLLogicControl * buildTLLogics()
Returns the built tls-logic control.
Definition: NLJunctionControlBuilder.cpp:448
WRITE_ERROR
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:245
MSTLLogicControl::closeNetworkReading
bool closeNetworkReading()
Lets MSTLLogicControl know that the network has been loaded.
Definition: MSTLLogicControl.cpp:636
SUMOXMLDefinitions.h
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:56
NLJunctionControlBuilder::getActiveKey
const std::string & getActiveKey() const
Returns the active key.
Definition: NLJunctionControlBuilder.cpp:476
NLJunctionControlBuilder::addLogicItem
void addLogicItem(int request, const std::string &response, const std::string &foes, bool cont)
Adds a logic item.
Definition: NLJunctionControlBuilder.cpp:349
TLTYPE_ACTUATED
Definition: SUMOXMLDefinitions.h:1196
NODETYPE_NOJUNCTION
Definition: SUMOXMLDefinitions.h:1062
NamedObjectCont::add
bool add(const std::string &id, T item)
Adds an item.
Definition: NamedObjectCont.h:66
NODETYPE_TRAFFIC_LIGHT
Definition: SUMOXMLDefinitions.h:1051
MSRailSignal.h