 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
36 const std::string&
id) :
67 for (
int i = 0; i < no; ++i) {
68 bool foundMajor =
false;
69 bool foundMinor =
false;
72 if (l->getOffState() ==
'o') {
74 }
else if (l->getOffState() ==
'O') {
77 WRITE_WARNING(
"Invalid 'off'-state for link " +
toString(l->getIndex()) +
" at junction '" + l->getJunction()->getID() +
"'");
80 if (foundMajor && foundMinor) {
83 state += foundMinor ?
'o' :
'O';
LinkVectorVector myLinks
The list of LinkVectors; each vector contains the links that belong to the same link index.
const MSPhaseDefinition & getPhase(int givenstep) const
Returns the definition of the phase from the given position within the plan.
#define WRITE_WARNING(msg)
~MSOffTrafficLightLogic()
Destructor.
int getCurrentPhaseIndex() const
Returns the current index within the program.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
const Phases & getPhases() const
Returns the phases of this tls program.
virtual void adaptLinkInformationFrom(const MSTrafficLightLogic &logic)
Applies information about controlled links and lanes from the given logic.
SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const
Returns the index of the logic at the given simulation step.
The parent class for traffic light logics.
MSTrafficLightLogic::Phases myPhaseDefinition
The phase definition (only one)
void rebuildPhase()
(Re)builds the internal phase definition
int getIndexFromOffset(SUMOTime offset) const
Returns the step (the phasenumber) of a given position of the cycle.
virtual void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const LinkVectorVector & getLinks() const
Returns the list of lists of all affected links.
void adaptLinkInformationFrom(const MSTrafficLightLogic &logic)
Applies information about controlled links and lanes from the given logic.
SUMOTime myDefaultCycleTime
The cycle time (without changes)
A class that stores and controls tls and switching of their programs.
The definition of a single phase of a tls logic.
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
MSOffTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id)
Constructor.
const std::string & getID() const
Returns the id.
SUMOTime getOffsetFromIndex(int index) const
Returns the position (start of a phase during a cycle) from of a given step.
Builds detectors for microsim.
int getPhaseNumber() const
Returns the number of phases.