136 const std::vector<int>& next = std::vector<int>(),
const std::string& name =
"",
int index = -1);
138 const std::vector<int>& next = std::vector<int>(),
const std::string& name =
"",
int index = -1);
155 void setPhaseNext(
int phaseIndex,
const std::vector<int>& next);
156 void setPhaseName(
int phaseIndex,
const std::string& name);
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.
PhaseDefinition(SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurArg, SUMOTime maxDurArg, const std::vector< int > &nextArg, const std::string &nameArg)
Constructor.
bool operator!=(const PhaseDefinition &pd) const
Comparison operator.
std::string state
The state definition.
~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.
SUMOTime getDuration() const
Returns the duration of the complete cycle.
void deleteStateIndex(int index)
remove the index from all phase states
SUMOTime myOffset
The tls program's offset.
int myNumLinks
The number of participating links.
void setPhaseMinDuration(int phaseIndex, SUMOTime duration)
NBTrafficLightLogic & operator=(const NBTrafficLightLogic &s)=delete
Invalidated assignment operator.
NBTrafficLightLogic(const std::string &id, const std::string &subid, int noLinks, SUMOTime offset=0, TrafficLightType type=TrafficLightType::STATIC)
Constructor.
void closeBuilding(bool checkVarDurations=true)
closes the building process
SUMOTime getOffset() const
Returns the offset of first switch.
const std::vector< PhaseDefinition > & getPhases() const
Returns the phases.
PhaseDefinitionVector myPhases
The junction logic's storage for traffic light phase list.
void setPhaseName(int phaseIndex, const std::string &name)
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)
int getNumLinks()
Returns the number of participating links.
const std::string & getProgramID() const
Returns the ProgramID.
void setType(TrafficLightType type)
set the algorithm type (static etc..)
void addStep(SUMOTime duration, const std::string &state, const std::vector< int > &next=std::vector< int >(), const std::string &name="", int index=-1)
Adds a phase to the logic.
void setPhaseNext(int phaseIndex, const std::vector< int > &next)
~NBTrafficLightLogic()
Destructor.
void setStateLength(int numLinks, LinkState fill=LINKSTATE_TL_RED)
void deletePhase(int index)
TrafficLightType getType() const
get the algorithm type (static etc..)
TrafficLightType myType
The algorithm type for the traffic light.
void setOffset(SUMOTime offset)
Sets the offset of this tls.
std::string mySubID
The tls program's subid.
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.