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 /****************************************************************************/
19 // A class that stores and controls tls and switching of their programs
20 /****************************************************************************/
21 #ifndef MSTLLogicControl_h
22 #define MSTLLogicControl_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #include <config.h>
29 
30 #include <vector>
31 #include <map>
33 #include <utils/common/Command.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
40 class MSLink;
41 class MSLane;
42 class MSPhaseDefinition;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
61 public:
67  public:
69  virtual ~OnSwitchAction() {};
70 
71 
74  virtual void execute() = 0;
75 
76  };
77 
78 
79 
87  public:
90 
91 
94 
95 
102  bool checkOriginalTLS() const;
103 
104 
112  bool addLogic(const std::string& programID, MSTrafficLightLogic* logic, bool netWasLoaded,
113  bool isNewDefault = true);
114 
115 
116 
117  MSTrafficLightLogic* getLogic(const std::string& programID) const;
119  std::vector<MSTrafficLightLogic*> getAllLogics() const;
120  void saveInitialStates();
121  bool isActive(const MSTrafficLightLogic* tl) const;
123  void switchTo(MSTLLogicControl& tlc, const std::string& programID);
124 
125  /* @brief get logic by programID. For the special case "off"
126  * instantiate an MSOffTrafficLightLogic */
128  const std::string& programID);
129 
130  /* @brief sets the state to the given string get for the special program "online"
131  * this program is instantiated only once */
133  const std::string& state);
134 
135 
136  void executeOnSwitchActions() const;
137  void addLink(MSLink* link, MSLane* lane, int pos);
138  void ignoreLinkIndex(int pos);
139 
140 
141  private:
144 
146  std::map<std::string, MSTrafficLightLogic*> myVariants;
147 
149  std::map<MSLink*, LinkState> myOriginalLinkStates;
150 
152  std::vector<OnSwitchAction*> mySwitchActions;
153 
154 
155  private:
158 
161 
162 
163  };
164 
165 
166 
169 
170 
173 
174 
192  bool closeNetworkReading();
193 
194 
201  void setTrafficLightSignals(SUMOTime t) const;
202 
203 
209  std::vector<MSTrafficLightLogic*> getAllLogics() const;
210 
211 
218  TLSLogicVariants& get(const std::string& id) const;
219 
220 
227  MSTrafficLightLogic* get(const std::string& id, const std::string& programID) const;
228 
229 
235  MSTrafficLightLogic* getActive(const std::string& id) const;
236 
237 
243  std::vector<std::string> getAllTLIds() const;
244 
245 
267  bool add(const std::string& id, const std::string& programID,
268  MSTrafficLightLogic* logic, bool newDefault = true);
269 
270 
271 
276  bool knows(const std::string& id) const;
277 
278 
283  bool isActive(const MSTrafficLightLogic* tl) const;
284 
285 
294  void switchTo(const std::string& id, const std::string& programID);
295 
296 
297 
300 
309  void addWAUT(SUMOTime refTime, const std::string& id,
310  const std::string& startProg);
311 
312 
321  void addWAUTSwitch(const std::string& wautid, SUMOTime when,
322  const std::string& to);
323 
324 
336  void addWAUTJunction(const std::string& wautid, const std::string& tls,
337  const std::string& proc, bool synchron);
338 
339 
350  void closeWAUT(const std::string& wautid);
352 
353 
354 
359  void check2Switch(SUMOTime step);
360 
361 
369  std::pair<SUMOTime, MSPhaseDefinition> getPhaseDef(const std::string& tlid) const;
370 
372  void switchOffAll();
373 
374 
375 
376 protected:
384  class SwitchInitCommand : public Command {
385  public:
391  SwitchInitCommand(MSTLLogicControl& p, const std::string& wautid, int index)
392  : myParent(p), myWAUTID(wautid), myIndex(index) { }
393 
394 
397 
398 
399 
402 
418  return myParent.initWautSwitch(*this);
419  }
421 
422 
423 
427  const std::string& getWAUTID() const {
428  return myWAUTID;
429  }
430 
431 
435  int& getIndex() {
436  return myIndex;
437  }
438 
439 
440  protected:
443 
445  std::string myWAUTID;
446 
448  int myIndex;
449 
450 
451  private:
454 
457 
458  };
459 
460 
461 
462 public:
470 
471 
472 protected:
476  struct WAUTSwitch {
480  std::string to;
481  };
482 
483 
487  struct WAUTJunction {
489  std::string junction;
491  std::string procedure;
493  bool synchron;
494  };
495 
496 
500  struct WAUT {
502  std::string id;
504  std::string startProg;
508  std::vector<WAUTSwitch> switches;
510  std::vector<WAUTJunction> junctions;
511  };
512 
513 
518  public:
528  bool synchron)
529  : myFrom(from), myTo(to), mySwitchSynchron(synchron), myWAUT(waut), myControl(control) { }
530 
531 
533  virtual ~WAUTSwitchProcedure() { }
534 
535 
540  virtual bool trySwitch(SUMOTime step) = 0;
541 
542 
543  protected:
554  bool isPosAtGSP(SUMOTime currentTime, const MSTrafficLightLogic& logic);
555 
556 
563 
564 
570  void switchToPos(SUMOTime simStep, MSTrafficLightLogic& logic, SUMOTime toTime);
571 
572 
580  int getGSPValue(const MSTrafficLightLogic& logic) const;
581 
582 
583  protected:
586 
589 
592 
595 
598 
599 
600  private:
603 
606 
607  };
608 
609 
615  public:
625  bool synchron);
626 
627 
630 
631 
636  bool trySwitch(SUMOTime step);
637 
638 
639  private:
642 
645 
646  };
647 
648 
649 
655  public:
665  bool synchron);
666 
669 
670 
675  bool trySwitch(SUMOTime step);
676 
677 
678  protected:
681  void adaptLogic(SUMOTime step);
682 
683 
684  private:
687 
690 
691  };
692 
693 
699  public:
709  bool synchron);
710 
711 
714 
715 
720  bool trySwitch(SUMOTime step);
721 
722 
723  protected:
729  void adaptLogic(SUMOTime step);
730 
731 
737  void stretchLogic(SUMOTime step, SUMOTime startPos, SUMOTime allStretchTime);
738 
739 
745  void cutLogic(SUMOTime step, SUMOTime startPos, SUMOTime allCutTime);
746 
747 
748  protected:
754  double begin;
756  double end;
758  double fac;
759 
760  };
761 
762 
767  int getStretchAreaNo(MSTrafficLightLogic* from) const;
768 
769 
778 
779 
780  private:
783 
786 
787  };
788 
789 
796  std::string junction;
803  };
804 
805 
807  std::map<std::string, WAUT*> myWAUTs;
808 
810  std::vector<WAUTSwitchProcess> myCurrentlySwitched;
811 
813  std::map<std::string, TLSLogicVariants*> myLogics;
814 
817 
818 
819 private:
822 
825 
826 };
827 
828 
829 #endif
830 
831 /****************************************************************************/
832 
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:834
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:696
MSTLLogicControl::WAUTSwitchProcedure::myWAUT
WAUT & myWAUT
The WAUT responsible for switching.
Definition: MSTLLogicControl.h:594
MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch
bool trySwitch(SUMOTime step)
Determines whether a switch is possible.
Definition: MSTLLogicControl.cpp:311
MSTLLogicControl::myCurrentlySwitched
std::vector< WAUTSwitchProcess > myCurrentlySwitched
A list of currently running switching procedures.
Definition: MSTLLogicControl.h:810
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:260
MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic
void stretchLogic(SUMOTime step, SUMOTime startPos, SUMOTime allStretchTime)
Stretches the logic to synchronize.
Definition: MSTLLogicControl.cpp:464
MSTLLogicControl::WAUTSwitchProcess::junction
std::string junction
The id of the junction to switch.
Definition: MSTLLogicControl.h:796
MSTLLogicControl::SwitchInitCommand::SwitchInitCommand
SwitchInitCommand(MSTLLogicControl &p, const std::string &wautid, int index)
Constructor.
Definition: MSTLLogicControl.h:391
MSTLLogicControl::TLSLogicVariants::addLogic
bool addLogic(const std::string &programID, MSTrafficLightLogic *logic, bool netWasLoaded, bool isNewDefault=true)
Adds a logic (program)
Definition: MSTLLogicControl.cpp:93
MSTLLogicControl::isActive
bool isActive(const MSTrafficLightLogic *tl) const
Returns whether the given tls program is the currently active for his tls.
Definition: MSTLLogicControl.cpp:648
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
MSTLLogicControl::WAUTJunction
Storage for a junction assigned to a WAUT.
Definition: MSTLLogicControl.h:487
MSTLLogicControl::OnSwitchAction::execute
virtual void execute()=0
Executes the action.
MSTLLogicControl::TLSLogicVariants::~TLSLogicVariants
~TLSLogicVariants()
Destructor.
Definition: MSTLLogicControl.cpp:54
MSTLLogicControl::WAUTSwitchProcedure_GSP::WAUTSwitchProcedure_GSP
WAUTSwitchProcedure_GSP(MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron)
Constructor.
Definition: MSTLLogicControl.cpp:301
MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic
void adaptLogic(SUMOTime step)
Determines the destination program's changes and applies them.
Definition: MSTLLogicControl.cpp:384
MSTLLogicControl::TLSLogicVariants::checkOriginalTLS
bool checkOriginalTLS() const
Verifies traffic lights loaded from the network.
Definition: MSTLLogicControl.cpp:66
MSTLLogicControl::WAUTSwitch::when
SUMOTime when
The time the WAUT shall switch the TLS.
Definition: MSTLLogicControl.h:478
MSTLLogicControl::MSTLLogicControl
MSTLLogicControl()
Constructor.
Definition: MSTLLogicControl.cpp:548
MSTLLogicControl::getAllTLIds
std::vector< std::string > getAllTLIds() const
Definition: MSTLLogicControl.cpp:604
MSTLLogicControl::WAUTSwitchProcess::proc
WAUTSwitchProcedure * proc
The used procedure.
Definition: MSTLLogicControl.h:802
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:712
MSTLLogicControl::WAUTSwitchProcedure::myFrom
MSTrafficLightLogic * myFrom
The current program of the tls to switch.
Definition: MSTLLogicControl.h:585
MSTLLogicControl::TLSLogicVariants::myOriginalLinkStates
std::map< MSLink *, LinkState > myOriginalLinkStates
Originally loaded link states.
Definition: MSTLLogicControl.h:149
MSTLLogicControl::getAllLogics
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
Definition: MSTLLogicControl.cpp:573
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
MSTLLogicControl::WAUTSwitchProcedure_GSP
This class switches using the GSP algorithm.
Definition: MSTLLogicControl.h:654
MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef
StretchBereichDef getStretchBereichDef(MSTrafficLightLogic *from, int index) const
Returns the numbered Stretch-area for the given program.
Definition: MSTLLogicControl.cpp:535
MSTLLogicControl::WAUTSwitchProcedure::switchToPos
void switchToPos(SUMOTime simStep, MSTrafficLightLogic &logic, SUMOTime toTime)
switches the given logic directly to the given position
Definition: MSTLLogicControl.cpp:269
MSTLLogicControl::WAUTSwitchProcedure::myTo
MSTrafficLightLogic * myTo
The program to switch the tls to.
Definition: MSTLLogicControl.h:588
MSTLLogicControl::SwitchInitCommand::getIndex
int & getIndex()
Returns a reference to the index.
Definition: MSTLLogicControl.h:435
MSTLLogicControl::WAUTSwitchProcedure::myControl
MSTLLogicControl & myControl
The control the logic belongs to.
Definition: MSTLLogicControl.h:597
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::~WAUTSwitchProcedure_JustSwitch
~WAUTSwitchProcedure_JustSwitch()
Destructor.
Definition: MSTLLogicControl.cpp:288
MSTLLogicControl::myLogics
std::map< std::string, TLSLogicVariants * > myLogics
A map from ids to the corresponding variants.
Definition: MSTLLogicControl.h:813
MSTLLogicControl::WAUTSwitch::to
std::string to
The program name the WAUT shall switch the TLS to.
Definition: MSTLLogicControl.h:480
MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::fac
double fac
The weight factor of a stretch/cut area.
Definition: MSTLLogicControl.h:758
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:565
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:614
MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo
int getStretchAreaNo(MSTrafficLightLogic *from) const
Returns the number of given Stretch-areas for the given program.
Definition: MSTLLogicControl.cpp:525
MSTLLogicControl::OnSwitchAction::~OnSwitchAction
virtual ~OnSwitchAction()
Destructor.
Definition: MSTLLogicControl.h:69
MSTLLogicControl::switchOffAll
void switchOffAll()
switch all logic variants to 'off'
Definition: MSTLLogicControl.cpp:841
MSTLLogicControl::knows
bool knows(const std::string &id) const
Returns the information whether the named tls is stored.
Definition: MSTLLogicControl.cpp:626
MSTLLogicControl::TLSLogicVariants::getActive
MSTrafficLightLogic * getActive() const
Definition: MSTLLogicControl.cpp:197
MSTLLogicControl::getActive
MSTrafficLightLogic * getActive(const std::string &id) const
Returns the active program of a named tls.
Definition: MSTLLogicControl.cpp:658
MSTLLogicControl::TLSLogicVariants::getLogic
MSTrafficLightLogic * getLogic(const std::string &programID) const
Definition: MSTLLogicControl.cpp:124
MSTLLogicControl::WAUTSwitchProcedure
This is the abstract base class for switching from one tls program to another.
Definition: MSTLLogicControl.h:517
MSTLLogicControl::WAUTSwitchProcess::from
MSTrafficLightLogic * from
The current program of the tls.
Definition: MSTLLogicControl.h:798
MSTLLogicControl::WAUTSwitchProcedure::~WAUTSwitchProcedure
virtual ~WAUTSwitchProcedure()
Destructor.
Definition: MSTLLogicControl.h:533
MSTLLogicControl::WAUTSwitchProcedure_Stretch::operator=
WAUTSwitchProcedure_Stretch & operator=(const WAUTSwitchProcedure_Stretch &)
Invalidated assignment operator.
MSTLLogicControl::TLSLogicVariants::getAllLogics
std::vector< MSTrafficLightLogic * > getAllLogics() const
Definition: MSTLLogicControl.cpp:180
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:356
MSTLLogicControl::get
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
Definition: MSTLLogicControl.cpp:584
MSTLLogicControl::WAUTSwitch
Storage for a WAUTs switch point.
Definition: MSTLLogicControl.h:476
MSTLLogicControl::WAUTSwitchProcess
An initialised switch process.
Definition: MSTLLogicControl.h:794
MSTLLogicControl::TLSLogicVariants::addLink
void addLink(MSLink *link, MSLane *lane, int pos)
Definition: MSTLLogicControl.cpp:220
MSTLLogicControl::myWAUTs
std::map< std::string, WAUT * > myWAUTs
A map of ids to corresponding WAUTs.
Definition: MSTLLogicControl.h:807
MSTLLogicControl::myNetWasLoaded
bool myNetWasLoaded
Information whether the net was completely loaded.
Definition: MSTLLogicControl.h:816
MSTLLogicControl::addWAUT
void addWAUT(SUMOTime refTime, const std::string &id, const std::string &startProg)
Adds a WAUT definition.
Definition: MSTLLogicControl.cpp:680
MSTLLogicControl::SwitchInitCommand::execute
SUMOTime execute(SUMOTime)
Begins a WAUT switch by executing the command.
Definition: MSTLLogicControl.h:417
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::trySwitch
bool trySwitch(SUMOTime step)
Determines whether a switch is possible.
Definition: MSTLLogicControl.cpp:292
MSTLLogicControl::WAUTSwitchProcedure::WAUTSwitchProcedure
WAUTSwitchProcedure(MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron)
Constructor.
Definition: MSTLLogicControl.h:526
MSTLLogicControl::TLSLogicVariants::switchTo
void switchTo(MSTLLogicControl &tlc, const std::string &programID)
Definition: MSTLLogicControl.cpp:203
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:56
MSTLLogicControl::WAUT::junctions
std::vector< WAUTJunction > junctions
The list of switches assigned to the WAUT.
Definition: MSTLLogicControl.h:510
MSTLLogicControl::WAUT
A WAUT definition.
Definition: MSTLLogicControl.h:500
MSTLLogicControl::TLSLogicVariants::addSwitchCommand
void addSwitchCommand(OnSwitchAction *c)
Definition: MSTLLogicControl.cpp:174
MSTLLogicControl::TLSLogicVariants::isActive
bool isActive(const MSTrafficLightLogic *tl) const
Definition: MSTLLogicControl.cpp:191
MSTLLogicControl::initWautSwitch
SUMOTime initWautSwitch(SwitchInitCommand &cmd)
Initialises switching a WAUT.
Definition: MSTLLogicControl.cpp:784
MSTLLogicControl::WAUTSwitchProcedure_Stretch
This class switches using the Stretch algorithm.
Definition: MSTLLogicControl.h:698
MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff
MSTrafficLightLogic * getLogicInstantiatingOff(MSTLLogicControl &tlc, const std::string &programID)
Definition: MSTLLogicControl.cpp:133
MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::end
double end
The end of a stretch/cut area (time, in s)
Definition: MSTLLogicControl.h:756
MSTLLogicControl::WAUT::switches
std::vector< WAUTSwitch > switches
The list of switches to be done by the WAUT.
Definition: MSTLLogicControl.h:508
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:152
MSTLLogicControl::TLSLogicVariants::myVariants
std::map< std::string, MSTrafficLightLogic * > myVariants
A map of subkeys to programs.
Definition: MSTLLogicControl.h:146
MSTLLogicControl::WAUT::id
std::string id
The id of the WAUT.
Definition: MSTLLogicControl.h:502
MSTLLogicControl::WAUT::refTime
SUMOTime refTime
The reference time (offset to the switch times)
Definition: MSTLLogicControl.h:506
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:668
MSTLLogicControl::closeWAUT
void closeWAUT(const std::string &wautid)
Closes loading of a WAUT.
Definition: MSTLLogicControl.cpp:750
MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline
void setStateInstantiatingOnline(MSTLLogicControl &tlc, const std::string &state)
Definition: MSTLLogicControl.cpp:152
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::WAUTSwitchProcedure_JustSwitch
WAUTSwitchProcedure_JustSwitch(MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron)
Constructor.
Definition: MSTLLogicControl.cpp:282
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:251
MSTLLogicControl::WAUT::startProg
std::string startProg
The name of the start program.
Definition: MSTLLogicControl.h:504
MSTLLogicControl::WAUTSwitchProcedure::getGSPValue
int getGSPValue(const MSTrafficLightLogic &logic) const
Returns the GSP-value.
Definition: MSTLLogicControl.cpp:241
MSTLLogicControl::TLSLogicVariants::ignoreLinkIndex
void ignoreLinkIndex(int pos)
Definition: MSTLLogicControl.cpp:227
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch
This class simply switches to the next program.
Definition: MSTLLogicControl.h:614
MSTLLogicControl::SwitchInitCommand::myWAUTID
std::string myWAUTID
The id of the WAUT that shall switch.
Definition: MSTLLogicControl.h:445
MSTLLogicControl::~MSTLLogicControl
~MSTLLogicControl()
Destructor.
Definition: MSTLLogicControl.cpp:552
Command
Base (microsim) event class.
Definition: Command.h:53
MSTLLogicControl::SwitchInitCommand::~SwitchInitCommand
~SwitchInitCommand()
Destructor.
Definition: MSTLLogicControl.h:396
MSTLLogicControl::WAUTJunction::synchron
bool synchron
Information whether this junction shall be switched synchron.
Definition: MSTLLogicControl.h:493
MSTLLogicControl::WAUTSwitchProcedure_GSP::~WAUTSwitchProcedure_GSP
~WAUTSwitchProcedure_GSP()
Destructor.
Definition: MSTLLogicControl.cpp:307
MSTLLogicControl::WAUTJunction::junction
std::string junction
The junction name.
Definition: MSTLLogicControl.h:489
MSTLLogicControl::TLSLogicVariants
Storage for all programs of a single tls.
Definition: MSTLLogicControl.h:86
MSTLLogicControl::SwitchInitCommand
This event-class is used to initialise a WAUT switch at a certain time.
Definition: MSTLLogicControl.h:384
MSTLLogicControl::SwitchInitCommand::myIndex
int myIndex
The current index within the WAUT switch table.
Definition: MSTLLogicControl.h:448
MSTLLogicControl::WAUTSwitchProcess::to
MSTrafficLightLogic * to
The program to switch the tls to.
Definition: MSTLLogicControl.h:800
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:416
MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic
void adaptLogic(SUMOTime step)
Stretches the destination program's phase to which the tls was switched.
Definition: MSTLLogicControl.cpp:329
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:60
MSTLLogicControl::TLSLogicVariants::executeOnSwitchActions
void executeOnSwitchActions() const
Definition: MSTLLogicControl.cpp:212
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:366
MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef
A definition of a stretch - Bereich.
Definition: MSTLLogicControl.h:752
MSTLLogicControl::WAUTJunction::procedure
std::string procedure
The procedure to switch the junction with.
Definition: MSTLLogicControl.h:491
MSPhaseDefinition
The definition of a single phase of a tls logic.
Definition: MSPhaseDefinition.h:52
MSTLLogicControl::OnSwitchAction
Base class for things to execute if a tls switches to a new phase.
Definition: MSTLLogicControl.h:66
MSTLLogicControl::TLSLogicVariants::TLSLogicVariants
TLSLogicVariants()
Constructor.
Definition: MSTLLogicControl.cpp:49
MSTLLogicControl::WAUTSwitchProcedure::mySwitchSynchron
bool mySwitchSynchron
Information whether to switch synchron (?)
Definition: MSTLLogicControl.h:591
MSTLLogicControl::TLSLogicVariants::saveInitialStates
void saveInitialStates()
Definition: MSTLLogicControl.cpp:87
MSTLLogicControl::SwitchInitCommand::myParent
MSTLLogicControl & myParent
The control to call.
Definition: MSTLLogicControl.h:442
MSTLLogicControl::check2Switch
void check2Switch(SUMOTime step)
Checks whether any WAUT is trying to switch a tls into another program.
Definition: MSTLLogicControl.cpp:819
MSTLLogicControl::WAUTSwitchProcedure::operator=
WAUTSwitchProcedure & operator=(const WAUTSwitchProcedure &)
Invalidated assignment operator.
MSTLLogicControl::WAUTSwitchProcedure_Stretch::~WAUTSwitchProcedure_Stretch
~WAUTSwitchProcedure_Stretch()
Destructor.
Definition: MSTLLogicControl.cpp:362
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:754
MSTLLogicControl::TLSLogicVariants::myCurrentProgram
MSTrafficLightLogic * myCurrentProgram
The currently used program.
Definition: MSTLLogicControl.h:143
MSTLLogicControl::SwitchInitCommand::getWAUTID
const std::string & getWAUTID() const
Returns the WAUT-id.
Definition: MSTLLogicControl.h:427
MSTLLogicControl::closeNetworkReading
bool closeNetworkReading()
Lets MSTLLogicControl know that the network has been loaded.
Definition: MSTLLogicControl.cpp:636
SUMOXMLDefinitions.h