Eclipse SUMO - Simulation of Urban MObility
MSTLLogicControl.h
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 // A class that stores and controls tls and switching of their programs
19 /****************************************************************************/
20 #ifndef MSTLLogicControl_h
21 #define MSTLLogicControl_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <vector>
30 #include <map>
32 #include <utils/common/Command.h>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
39 class MSLink;
40 class MSLane;
41 class MSPhaseDefinition;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
60 public:
66  public:
68  virtual ~OnSwitchAction() {};
69 
70 
73  virtual void execute() = 0;
74 
75  };
76 
77 
78 
86  public:
89 
90 
93 
94 
101  bool checkOriginalTLS() const;
102 
103 
111  bool addLogic(const std::string& programID, MSTrafficLightLogic* logic, bool netWasLoaded,
112  bool isNewDefault = true);
113 
114 
115 
116  MSTrafficLightLogic* getLogic(const std::string& programID) const;
118  std::vector<MSTrafficLightLogic*> getAllLogics() const;
119  void saveInitialStates();
120  bool isActive(const MSTrafficLightLogic* tl) const;
122  void switchTo(MSTLLogicControl& tlc, const std::string& programID);
123 
124  /* @brief get logic by programID. For the special case "off"
125  * instantiate an MSOffTrafficLightLogic */
127  const std::string& programID);
128 
129  /* @brief sets the state to the given string get for the special program "online"
130  * this program is instantiated only once */
132  const std::string& state);
133 
134 
135  void executeOnSwitchActions() const;
136  void addLink(MSLink* link, MSLane* lane, int pos);
137  void ignoreLinkIndex(int pos);
138 
139 
140  private:
143 
145  std::map<std::string, MSTrafficLightLogic*> myVariants;
146 
148  std::map<MSLink*, LinkState> myOriginalLinkStates;
149 
151  std::vector<OnSwitchAction*> mySwitchActions;
152 
153 
154  private:
157 
160 
161 
162  };
163 
164 
165 
168 
169 
172 
173 
191  bool closeNetworkReading();
192 
193 
200  void setTrafficLightSignals(SUMOTime t) const;
201 
202 
208  std::vector<MSTrafficLightLogic*> getAllLogics() const;
209 
210 
217  TLSLogicVariants& get(const std::string& id) const;
218 
219 
226  MSTrafficLightLogic* get(const std::string& id, const std::string& programID) const;
227 
228 
234  MSTrafficLightLogic* getActive(const std::string& id) const;
235 
236 
242  std::vector<std::string> getAllTLIds() const;
243 
244 
266  bool add(const std::string& id, const std::string& programID,
267  MSTrafficLightLogic* logic, bool newDefault = true);
268 
269 
270 
275  bool knows(const std::string& id) const;
276 
277 
282  bool isActive(const MSTrafficLightLogic* tl) const;
283 
284 
293  void switchTo(const std::string& id, const std::string& programID);
294 
295 
296 
299 
308  void addWAUT(SUMOTime refTime, const std::string& id,
309  const std::string& startProg);
310 
311 
320  void addWAUTSwitch(const std::string& wautid, SUMOTime when,
321  const std::string& to);
322 
323 
335  void addWAUTJunction(const std::string& wautid, const std::string& tls,
336  const std::string& proc, bool synchron);
337 
338 
349  void closeWAUT(const std::string& wautid);
351 
352 
353 
358  void check2Switch(SUMOTime step);
359 
360 
368  std::pair<SUMOTime, MSPhaseDefinition> getPhaseDef(const std::string& tlid) const;
369 
371  void switchOffAll();
372 
373 
374 
375 protected:
383  class SwitchInitCommand : public Command {
384  public:
390  SwitchInitCommand(MSTLLogicControl& p, const std::string& wautid, int index)
391  : myParent(p), myWAUTID(wautid), myIndex(index) { }
392 
393 
396 
397 
398 
401 
417  return myParent.initWautSwitch(*this);
418  }
420 
421 
422 
426  const std::string& getWAUTID() const {
427  return myWAUTID;
428  }
429 
430 
434  int& getIndex() {
435  return myIndex;
436  }
437 
438 
439  protected:
442 
444  std::string myWAUTID;
445 
447  int myIndex;
448 
449 
450  private:
453 
456 
457  };
458 
459 
460 
461 public:
469 
470 
471 protected:
475  struct WAUTSwitch {
479  std::string to;
480  };
481 
482 
486  struct WAUTJunction {
488  std::string junction;
490  std::string procedure;
492  bool synchron;
493  };
494 
495 
499  struct WAUT {
501  std::string id;
503  std::string startProg;
507  std::vector<WAUTSwitch> switches;
509  std::vector<WAUTJunction> junctions;
510  };
511 
512 
517  public:
527  bool synchron)
528  : myFrom(from), myTo(to), mySwitchSynchron(synchron), myWAUT(waut), myControl(control) { }
529 
530 
532  virtual ~WAUTSwitchProcedure() { }
533 
534 
539  virtual bool trySwitch(SUMOTime step) = 0;
540 
541 
542  protected:
553  bool isPosAtGSP(SUMOTime currentTime, const MSTrafficLightLogic& logic);
554 
555 
562 
563 
569  void switchToPos(SUMOTime simStep, MSTrafficLightLogic& logic, SUMOTime toTime);
570 
571 
579  int getGSPValue(const MSTrafficLightLogic& logic) const;
580 
581 
582  protected:
585 
588 
591 
594 
597 
598 
599  private:
602 
605 
606  };
607 
608 
614  public:
624  bool synchron);
625 
626 
629 
630 
635  bool trySwitch(SUMOTime step);
636 
637 
638  private:
641 
644 
645  };
646 
647 
648 
654  public:
664  bool synchron);
665 
668 
669 
674  bool trySwitch(SUMOTime step);
675 
676 
677  protected:
680  void adaptLogic(SUMOTime step);
681 
682 
683  private:
686 
689 
690  };
691 
692 
698  public:
708  bool synchron);
709 
710 
713 
714 
719  bool trySwitch(SUMOTime step);
720 
721 
722  protected:
728  void adaptLogic(SUMOTime step);
729 
730 
736  void stretchLogic(SUMOTime step, SUMOTime startPos, SUMOTime allStretchTime);
737 
738 
744  void cutLogic(SUMOTime step, SUMOTime startPos, SUMOTime allCutTime);
745 
746 
747  protected:
753  double begin;
755  double end;
757  double fac;
758 
759  };
760 
761 
766  int getStretchAreaNo(MSTrafficLightLogic* from) const;
767 
768 
777 
778 
779  private:
782 
785 
786  };
787 
788 
795  std::string junction;
802  };
803 
804 
806  std::map<std::string, WAUT*> myWAUTs;
807 
809  std::vector<WAUTSwitchProcess> myCurrentlySwitched;
810 
812  std::map<std::string, TLSLogicVariants*> myLogics;
813 
816 
817 
818 private:
821 
824 
825 };
826 
827 
828 #endif
829 
830 /****************************************************************************/
831 
MSTLLogicControl::getPhaseDef
std::pair< SUMOTime, MSPhaseDefinition > getPhaseDef(const std::string &tlid) const
return the complete phase definition for a named traffic lights logic
Definition: MSTLLogicControl.cpp:839
MSTLLogicControl::addWAUTSwitch
void addWAUTSwitch(const std::string &wautid, SUMOTime when, const std::string &to)
Adds a WAUT switch step to a previously built WAUT.
Definition: MSTLLogicControl.cpp:701
MSTLLogicControl::WAUTSwitchProcedure::myWAUT
WAUT & myWAUT
The WAUT responsible for switching.
Definition: MSTLLogicControl.h:593
MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch
bool trySwitch(SUMOTime step)
Determines whether a switch is possible.
Definition: MSTLLogicControl.cpp:316
MSTLLogicControl::myCurrentlySwitched
std::vector< WAUTSwitchProcess > myCurrentlySwitched
A list of currently running switching procedures.
Definition: MSTLLogicControl.h:809
MSTLLogicControl::WAUTSwitchProcedure::getDiffToStartOfPhase
SUMOTime getDiffToStartOfPhase(MSTrafficLightLogic &logic, SUMOTime toTime)
Returns the difference between a given time and the start of the phase.
Definition: MSTLLogicControl.cpp:265
MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic
void stretchLogic(SUMOTime step, SUMOTime startPos, SUMOTime allStretchTime)
Stretches the logic to synchronize.
Definition: MSTLLogicControl.cpp:469
MSTLLogicControl::WAUTSwitchProcess::junction
std::string junction
The id of the junction to switch.
Definition: MSTLLogicControl.h:795
MSTLLogicControl::SwitchInitCommand::SwitchInitCommand
SwitchInitCommand(MSTLLogicControl &p, const std::string &wautid, int index)
Constructor.
Definition: MSTLLogicControl.h:390
MSTLLogicControl::TLSLogicVariants::addLogic
bool addLogic(const std::string &programID, MSTrafficLightLogic *logic, bool netWasLoaded, bool isNewDefault=true)
Adds a logic (program)
Definition: MSTLLogicControl.cpp:92
MSTLLogicControl::isActive
bool isActive(const MSTrafficLightLogic *tl) const
Returns whether the given tls program is the currently active for his tls.
Definition: MSTLLogicControl.cpp:653
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSTLLogicControl::WAUTJunction
Storage for a junction assigned to a WAUT.
Definition: MSTLLogicControl.h:486
MSTLLogicControl::OnSwitchAction::execute
virtual void execute()=0
Executes the action.
MSTLLogicControl::TLSLogicVariants::~TLSLogicVariants
~TLSLogicVariants()
Destructor.
Definition: MSTLLogicControl.cpp:53
MSTLLogicControl::WAUTSwitchProcedure_GSP::WAUTSwitchProcedure_GSP
WAUTSwitchProcedure_GSP(MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron)
Constructor.
Definition: MSTLLogicControl.cpp:306
MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic
void adaptLogic(SUMOTime step)
Determines the destination program's changes and applies them.
Definition: MSTLLogicControl.cpp:389
MSTLLogicControl::TLSLogicVariants::checkOriginalTLS
bool checkOriginalTLS() const
Verifies traffic lights loaded from the network.
Definition: MSTLLogicControl.cpp:65
MSTLLogicControl::WAUTSwitch::when
SUMOTime when
The time the WAUT shall switch the TLS.
Definition: MSTLLogicControl.h:477
MSTLLogicControl::MSTLLogicControl
MSTLLogicControl()
Constructor.
Definition: MSTLLogicControl.cpp:553
MSTLLogicControl::getAllTLIds
std::vector< std::string > getAllTLIds() const
Definition: MSTLLogicControl.cpp:609
MSTLLogicControl::WAUTSwitchProcess::proc
WAUTSwitchProcedure * proc
The used procedure.
Definition: MSTLLogicControl.h:801
MSTLLogicControl::operator=
MSTLLogicControl & operator=(const MSTLLogicControl &)
Invalidated assignment operator.
MSTLLogicControl::addWAUTJunction
void addWAUTJunction(const std::string &wautid, const std::string &tls, const std::string &proc, bool synchron)
Adds a tls to the list of tls to be switched by the named WAUT.
Definition: MSTLLogicControl.cpp:717
MSTLLogicControl::WAUTSwitchProcedure::myFrom
MSTrafficLightLogic * myFrom
The current program of the tls to switch.
Definition: MSTLLogicControl.h:584
MSTLLogicControl::TLSLogicVariants::myOriginalLinkStates
std::map< MSLink *, LinkState > myOriginalLinkStates
Originally loaded link states.
Definition: MSTLLogicControl.h:148
MSTLLogicControl::getAllLogics
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
Definition: MSTLLogicControl.cpp:578
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSTLLogicControl::WAUTSwitchProcedure_GSP
This class switches using the GSP algorithm.
Definition: MSTLLogicControl.h:653
MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef
StretchBereichDef getStretchBereichDef(MSTrafficLightLogic *from, int index) const
Returns the numbered Stretch-area for the given program.
Definition: MSTLLogicControl.cpp:540
MSTLLogicControl::WAUTSwitchProcedure::switchToPos
void switchToPos(SUMOTime simStep, MSTrafficLightLogic &logic, SUMOTime toTime)
switches the given logic directly to the given position
Definition: MSTLLogicControl.cpp:274
MSTLLogicControl::WAUTSwitchProcedure::myTo
MSTrafficLightLogic * myTo
The program to switch the tls to.
Definition: MSTLLogicControl.h:587
MSTLLogicControl::SwitchInitCommand::getIndex
int & getIndex()
Returns a reference to the index.
Definition: MSTLLogicControl.h:434
MSTLLogicControl::WAUTSwitchProcedure::myControl
MSTLLogicControl & myControl
The control the logic belongs to.
Definition: MSTLLogicControl.h:596
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::~WAUTSwitchProcedure_JustSwitch
~WAUTSwitchProcedure_JustSwitch()
Destructor.
Definition: MSTLLogicControl.cpp:293
MSTLLogicControl::myLogics
std::map< std::string, TLSLogicVariants * > myLogics
A map from ids to the corresponding variants.
Definition: MSTLLogicControl.h:812
MSTLLogicControl::WAUTSwitch::to
std::string to
The program name the WAUT shall switch the TLS to.
Definition: MSTLLogicControl.h:479
MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::fac
double fac
The weight factor of a stretch/cut area.
Definition: MSTLLogicControl.h:757
MSTLLogicControl::setTrafficLightSignals
void setTrafficLightSignals(SUMOTime t) const
Lets all running (current) tls programs apply their current signal states to links they control.
Definition: MSTLLogicControl.cpp:570
MSTLLogicControl::add
bool add(const std::string &id, const std::string &programID, MSTrafficLightLogic *logic, bool newDefault=true)
Adds a tls program to the container.
Definition: MSTLLogicControl.cpp:619
MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo
int getStretchAreaNo(MSTrafficLightLogic *from) const
Returns the number of given Stretch-areas for the given program.
Definition: MSTLLogicControl.cpp:530
MSTLLogicControl::OnSwitchAction::~OnSwitchAction
virtual ~OnSwitchAction()
Destructor.
Definition: MSTLLogicControl.h:68
MSTLLogicControl::switchOffAll
void switchOffAll()
switch all logic variants to 'off'
Definition: MSTLLogicControl.cpp:846
MSTLLogicControl::knows
bool knows(const std::string &id) const
Returns the information whether the named tls is stored.
Definition: MSTLLogicControl.cpp:631
MSTLLogicControl::TLSLogicVariants::getActive
MSTrafficLightLogic * getActive() const
Definition: MSTLLogicControl.cpp:200
MSTLLogicControl::getActive
MSTrafficLightLogic * getActive(const std::string &id) const
Returns the active program of a named tls.
Definition: MSTLLogicControl.cpp:663
MSTLLogicControl::TLSLogicVariants::getLogic
MSTrafficLightLogic * getLogic(const std::string &programID) const
Definition: MSTLLogicControl.cpp:127
MSTLLogicControl::WAUTSwitchProcedure
This is the abstract base class for switching from one tls program to another.
Definition: MSTLLogicControl.h:516
MSTLLogicControl::WAUTSwitchProcess::from
MSTrafficLightLogic * from
The current program of the tls.
Definition: MSTLLogicControl.h:797
MSTLLogicControl::WAUTSwitchProcedure::~WAUTSwitchProcedure
virtual ~WAUTSwitchProcedure()
Destructor.
Definition: MSTLLogicControl.h:532
MSTLLogicControl::WAUTSwitchProcedure_Stretch::operator=
WAUTSwitchProcedure_Stretch & operator=(const WAUTSwitchProcedure_Stretch &)
Invalidated assignment operator.
MSTLLogicControl::TLSLogicVariants::getAllLogics
std::vector< MSTrafficLightLogic * > getAllLogics() const
Definition: MSTLLogicControl.cpp:183
MSTLLogicControl::WAUTSwitchProcedure_GSP::operator=
WAUTSwitchProcedure_GSP & operator=(const WAUTSwitchProcedure_GSP &)
Invalidated assignment operator.
MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch
WAUTSwitchProcedure_Stretch(MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron)
Constructor.
Definition: MSTLLogicControl.cpp:361
MSTLLogicControl::get
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
Definition: MSTLLogicControl.cpp:589
MSTLLogicControl::WAUTSwitch
Storage for a WAUTs switch point.
Definition: MSTLLogicControl.h:475
MSTLLogicControl::WAUTSwitchProcess
An initialised switch process.
Definition: MSTLLogicControl.h:793
MSTLLogicControl::TLSLogicVariants::addLink
void addLink(MSLink *link, MSLane *lane, int pos)
Definition: MSTLLogicControl.cpp:225
MSTLLogicControl::myWAUTs
std::map< std::string, WAUT * > myWAUTs
A map of ids to corresponding WAUTs.
Definition: MSTLLogicControl.h:806
MSTLLogicControl::myNetWasLoaded
bool myNetWasLoaded
Information whether the net was completely loaded.
Definition: MSTLLogicControl.h:815
MSTLLogicControl::addWAUT
void addWAUT(SUMOTime refTime, const std::string &id, const std::string &startProg)
Adds a WAUT definition.
Definition: MSTLLogicControl.cpp:685
MSTLLogicControl::SwitchInitCommand::execute
SUMOTime execute(SUMOTime)
Begins a WAUT switch by executing the command.
Definition: MSTLLogicControl.h:416
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::trySwitch
bool trySwitch(SUMOTime step)
Determines whether a switch is possible.
Definition: MSTLLogicControl.cpp:297
MSTLLogicControl::WAUTSwitchProcedure::WAUTSwitchProcedure
WAUTSwitchProcedure(MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron)
Constructor.
Definition: MSTLLogicControl.h:525
MSTLLogicControl::TLSLogicVariants::switchTo
void switchTo(MSTLLogicControl &tlc, const std::string &programID)
Definition: MSTLLogicControl.cpp:206
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:55
MSTLLogicControl::WAUT::junctions
std::vector< WAUTJunction > junctions
The list of switches assigned to the WAUT.
Definition: MSTLLogicControl.h:509
MSTLLogicControl::WAUT
A WAUT definition.
Definition: MSTLLogicControl.h:499
MSTLLogicControl::TLSLogicVariants::addSwitchCommand
void addSwitchCommand(OnSwitchAction *c)
Definition: MSTLLogicControl.cpp:177
MSTLLogicControl::TLSLogicVariants::isActive
bool isActive(const MSTrafficLightLogic *tl) const
Definition: MSTLLogicControl.cpp:194
MSTLLogicControl::initWautSwitch
SUMOTime initWautSwitch(SwitchInitCommand &cmd)
Initialises switching a WAUT.
Definition: MSTLLogicControl.cpp:789
MSTLLogicControl::WAUTSwitchProcedure_Stretch
This class switches using the Stretch algorithm.
Definition: MSTLLogicControl.h:697
MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff
MSTrafficLightLogic * getLogicInstantiatingOff(MSTLLogicControl &tlc, const std::string &programID)
Definition: MSTLLogicControl.cpp:136
MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::end
double end
The end of a stretch/cut area (time, in s)
Definition: MSTLLogicControl.h:755
MSTLLogicControl::WAUT::switches
std::vector< WAUTSwitch > switches
The list of switches to be done by the WAUT.
Definition: MSTLLogicControl.h:507
MSTLLogicControl::SwitchInitCommand::operator=
SwitchInitCommand & operator=(const SwitchInitCommand &)
Invalidated assignment operator.
MSTLLogicControl::TLSLogicVariants::mySwitchActions
std::vector< OnSwitchAction * > mySwitchActions
The list of actions/commands to execute on switch.
Definition: MSTLLogicControl.h:151
MSTLLogicControl::TLSLogicVariants::myVariants
std::map< std::string, MSTrafficLightLogic * > myVariants
A map of subkeys to programs.
Definition: MSTLLogicControl.h:145
MSTLLogicControl::WAUT::id
std::string id
The id of the WAUT.
Definition: MSTLLogicControl.h:501
MSTLLogicControl::WAUT::refTime
SUMOTime refTime
The reference time (offset to the switch times)
Definition: MSTLLogicControl.h:505
MSTLLogicControl::switchTo
void switchTo(const std::string &id, const std::string &programID)
Switches the named (id) tls to the named (programID) program.
Definition: MSTLLogicControl.cpp:673
MSTLLogicControl::closeWAUT
void closeWAUT(const std::string &wautid)
Closes loading of a WAUT.
Definition: MSTLLogicControl.cpp:755
MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline
void setStateInstantiatingOnline(MSTLLogicControl &tlc, const std::string &state)
Definition: MSTLLogicControl.cpp:155
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::WAUTSwitchProcedure_JustSwitch
WAUTSwitchProcedure_JustSwitch(MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron)
Constructor.
Definition: MSTLLogicControl.cpp:287
MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP
bool isPosAtGSP(SUMOTime currentTime, const MSTrafficLightLogic &logic)
Checks, whether the position of a signal programm is at the GSP ("GuenstigerUmschaltPunkt")
Definition: MSTLLogicControl.cpp:256
MSTLLogicControl::WAUT::startProg
std::string startProg
The name of the start program.
Definition: MSTLLogicControl.h:503
MSTLLogicControl::WAUTSwitchProcedure::getGSPValue
int getGSPValue(const MSTrafficLightLogic &logic) const
Returns the GSP-value.
Definition: MSTLLogicControl.cpp:246
MSTLLogicControl::TLSLogicVariants::ignoreLinkIndex
void ignoreLinkIndex(int pos)
Definition: MSTLLogicControl.cpp:232
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch
This class simply switches to the next program.
Definition: MSTLLogicControl.h:613
MSTLLogicControl::SwitchInitCommand::myWAUTID
std::string myWAUTID
The id of the WAUT that shall switch.
Definition: MSTLLogicControl.h:444
MSTLLogicControl::~MSTLLogicControl
~MSTLLogicControl()
Destructor.
Definition: MSTLLogicControl.cpp:557
Command
Base (microsim) event class.
Definition: Command.h:52
MSTLLogicControl::SwitchInitCommand::~SwitchInitCommand
~SwitchInitCommand()
Destructor.
Definition: MSTLLogicControl.h:395
MSTLLogicControl::WAUTJunction::synchron
bool synchron
Information whether this junction shall be switched synchron.
Definition: MSTLLogicControl.h:492
MSTLLogicControl::WAUTSwitchProcedure_GSP::~WAUTSwitchProcedure_GSP
~WAUTSwitchProcedure_GSP()
Destructor.
Definition: MSTLLogicControl.cpp:312
MSTLLogicControl::WAUTJunction::junction
std::string junction
The junction name.
Definition: MSTLLogicControl.h:488
MSTLLogicControl::TLSLogicVariants
Storage for all programs of a single tls.
Definition: MSTLLogicControl.h:85
MSTLLogicControl::SwitchInitCommand
This event-class is used to initialise a WAUT switch at a certain time.
Definition: MSTLLogicControl.h:383
MSTLLogicControl::SwitchInitCommand::myIndex
int myIndex
The current index within the WAUT switch table.
Definition: MSTLLogicControl.h:447
MSTLLogicControl::WAUTSwitchProcess::to
MSTrafficLightLogic * to
The program to switch the tls to.
Definition: MSTLLogicControl.h:799
config.h
MSTLLogicControl::WAUTSwitchProcedure::trySwitch
virtual bool trySwitch(SUMOTime step)=0
Determines whether a switch is possible.
MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic
void cutLogic(SUMOTime step, SUMOTime startPos, SUMOTime allCutTime)
Cuts the logic to synchronize.
Definition: MSTLLogicControl.cpp:421
MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic
void adaptLogic(SUMOTime step)
Stretches the destination program's phase to which the tls was switched.
Definition: MSTLLogicControl.cpp:334
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:59
MSTLLogicControl::TLSLogicVariants::executeOnSwitchActions
void executeOnSwitchActions() const
Definition: MSTLLogicControl.cpp:217
MSTLLogicControl::TLSLogicVariants::operator=
TLSLogicVariants & operator=(const TLSLogicVariants &)
Invalidated assignment operator.
Command.h
MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch
bool trySwitch(SUMOTime step)
Determines whether a switch is possible.
Definition: MSTLLogicControl.cpp:371
MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef
A definition of a stretch - Bereich.
Definition: MSTLLogicControl.h:751
MSTLLogicControl::WAUTJunction::procedure
std::string procedure
The procedure to switch the junction with.
Definition: MSTLLogicControl.h:490
MSPhaseDefinition
The definition of a single phase of a tls logic.
Definition: MSPhaseDefinition.h:51
MSTLLogicControl::OnSwitchAction
Base class for things to execute if a tls switches to a new phase.
Definition: MSTLLogicControl.h:65
MSTLLogicControl::TLSLogicVariants::TLSLogicVariants
TLSLogicVariants()
Constructor.
Definition: MSTLLogicControl.cpp:48
MSTLLogicControl::WAUTSwitchProcedure::mySwitchSynchron
bool mySwitchSynchron
Information whether to switch synchron (?)
Definition: MSTLLogicControl.h:590
MSTLLogicControl::TLSLogicVariants::saveInitialStates
void saveInitialStates()
Definition: MSTLLogicControl.cpp:86
MSTLLogicControl::SwitchInitCommand::myParent
MSTLLogicControl & myParent
The control to call.
Definition: MSTLLogicControl.h:441
MSTLLogicControl::check2Switch
void check2Switch(SUMOTime step)
Checks whether any WAUT is trying to switch a tls into another program.
Definition: MSTLLogicControl.cpp:824
MSTLLogicControl::WAUTSwitchProcedure::operator=
WAUTSwitchProcedure & operator=(const WAUTSwitchProcedure &)
Invalidated assignment operator.
MSTLLogicControl::WAUTSwitchProcedure_Stretch::~WAUTSwitchProcedure_Stretch
~WAUTSwitchProcedure_Stretch()
Destructor.
Definition: MSTLLogicControl.cpp:367
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::operator=
WAUTSwitchProcedure_JustSwitch & operator=(const WAUTSwitchProcedure_JustSwitch &)
Invalidated assignment operator.
MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::begin
double begin
The begin of a stretch/cut area (time, in s)
Definition: MSTLLogicControl.h:753
MSTLLogicControl::TLSLogicVariants::myCurrentProgram
MSTrafficLightLogic * myCurrentProgram
The currently used program.
Definition: MSTLLogicControl.h:142
MSTLLogicControl::SwitchInitCommand::getWAUTID
const std::string & getWAUTID() const
Returns the WAUT-id.
Definition: MSTLLogicControl.h:426
MSTLLogicControl::closeNetworkReading
bool closeNetworkReading()
Lets MSTLLogicControl know that the network has been loaded.
Definition: MSTLLogicControl.cpp:641
SUMOXMLDefinitions.h