97 const SUMOTime red_,
const std::vector<int>& next_,
const std::string& name_) :
163 void addStep(
const SUMOTime duration,
const std::string& state,
const std::vector<int>& next = std::vector<int>(),
164 const std::string& name =
"",
const int index = -1);
188 const std::string& name =
"",
189 const std::vector<int>& next = std::vector<int>(),
251 void setPhaseNext(
int phaseIndex,
const std::vector<int>& next);
257 void setPhaseName(
int phaseIndex,
const std::string& name);
273 void swapPhase(
int indexPhaseA,
int indexPhaseB);
319 void copyPhase(
const int origin,
const int destination) {
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_TL_RED
The link has red light (must brake)
The definition of a single phase of the logic.
SUMOTime vehExt
veh ext (for NEMA)
SUMOTime latestEnd
maximum duration duration (for actuated)
bool operator!=(const PhaseDefinition &pd) const
Comparison operator.
SUMOTime earliestEnd
minimum duration (for actuated)
SUMOTime red
red (for NEMA)
SUMOTime maxDur
maximum duration duration (for actuated)
SUMOTime yellow
yellow (for NEMA)
std::string state
The state definition.
PhaseDefinition(const SUMOTime duration_, const std::string &state_, const SUMOTime minDur_, const SUMOTime maxDur_, const SUMOTime earliestEnd_, const SUMOTime latestEnd_, const SUMOTime vehExt_, const SUMOTime yellow_, const SUMOTime red_, const std::vector< int > &next_, const std::string &name_)
Constructor.
SUMOTime minDur
minimum duration (for actuated)
~PhaseDefinition()
Destructor.
std::string name
option phase name
SUMOTime duration
The duration of the phase in s.
std::vector< int > next
next phase indices or empty list
A SUMO-compliant built logic for a traffic light.
void copyPhase(const int origin, const int destination)
copy phase values in other
SUMOTime getDuration() const
Returns the duration of the complete cycle.
void setPhaseVehExt(int phaseIndex, SUMOTime duration)
Modifies the veh ex for an existing phase (used by netedit)
void deleteStateIndex(int index)
remove the index from all phase states
SUMOTime myOffset
The tls program's offset.
void resetPhases()
deletes all phases and reset the expect number of links
void setPhaseEarliestEnd(int phaseIndex, SUMOTime duration)
Modifies the min duration for an existing phase (used by netedit)
void setPhaseRed(int phaseIndex, SUMOTime duration)
Modifies the veh ex for an existing phase (used by netedit)
int myNumLinks
The number of participating links.
void setPhaseMinDuration(int phaseIndex, SUMOTime duration)
Modifies the min duration for an existing phase (used by netedit)
void swaplastPhase()
swap first phase
void closeBuilding(bool checkVarDurations=true)
closes the building process
void swapPhase(int indexPhaseA, int indexPhaseB)
SUMOTime getOffset() const
Returns the offset of first switch.
NBTrafficLightLogic & operator=(const NBTrafficLightLogic &s)=delete
Invalidated assignment operator.
void overrideState(int phaseIndex, const char c)
override state with the given character(used by netedit)
PhaseDefinitionVector myPhases
The junction logic's storage for traffic light phase list.
void setPhaseName(int phaseIndex, const std::string &name)
Modifies the phase name (used by netedit)
void setPhaseDuration(int phaseIndex, SUMOTime duration)
Modifies the duration for an existing phase (used by netedit)
void setPhaseState(int phaseIndex, int tlIndex, LinkState linkState)
Modifies the state for an existing phase (used by netedit)
void setPhaseMaxDuration(int phaseIndex, SUMOTime duration)
Modifies the max duration for an existing phase (used by netedit)
int getNumLinks()
Returns the number of participating links.
void setPhaseYellow(int phaseIndex, SUMOTime duration)
Modifies the veh ex for an existing phase (used by netedit)
void setType(TrafficLightType type)
set the algorithm type (static etc..)
void setPhaseLatestEnd(int phaseIndex, SUMOTime duration)
Modifies the max duration for an existing phase (used by netedit)
void setPhaseNext(int phaseIndex, const std::vector< int > &next)
Modifies the next phase (used by netedit)
~NBTrafficLightLogic()
Destructor.
void setStateLength(int numLinks, LinkState fill=LINKSTATE_TL_RED)
void deletePhase(int index)
TrafficLightType getType() const
get the algorithm type (static etc..)
void swapfirstPhase()
swap first phase
TrafficLightType myType
The algorithm type for the traffic light.
void setOffset(SUMOTime offset)
Sets the offset of this tls.
const std::string & getProgramID() const
Returns the ProgramID.
std::string mySubID
The tls program's subid.
const std::vector< PhaseDefinition > & getPhases() const
Returns the phases.
void addStep(const SUMOTime duration, const std::string &state, const std::vector< int > &next=std::vector< int >(), const std::string &name="", const int index=-1)
Adds a phase to the logic (static)
void setProgramID(const std::string &programID)
Sets the programID.
std::vector< PhaseDefinition > PhaseDefinitionVector
Definition of a vector of traffic light phases.
Base class for objects which have an id.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.