 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
19 #ifndef NBTrafficLightLogic_h
20 #define NBTrafficLightLogic_h
139 const std::vector<int>& next = std::vector<int>(),
const std::string& name =
"",
int index = -1);
141 const std::vector<int>& next = std::vector<int>(),
const std::string& name =
"",
int index = -1);
158 void setPhaseNext(
int phaseIndex,
const std::vector<int>& next);
159 void setPhaseName(
int phaseIndex,
const std::string& name);
SUMOTime getDuration() const
Returns the duration of the complete cycle.
An upper class for objects with additional parameters.
void setPhaseName(int phaseIndex, const std::string &name)
NBTrafficLightLogic & operator=(const NBTrafficLightLogic &s)
Invalidated assignment operator.
Base class for objects which have an id.
SUMOTime getOffset() const
Returns the offset of first switch.
Static storage of an output device and its base (abstract) implementation.
std::vector< int > next
next phase indices or empty list
std::vector< PhaseDefinition > PhaseDefinitionVector
Definition of a vector of traffic light phases.
void closeBuilding(bool checkVarDurations=true)
closes the building process
void setPhaseDuration(int phaseIndex, SUMOTime duration)
Modifies the duration for an existing phase (used by NETEDIT)
SUMOTime duration
The duration of the phase in s.
TrafficLightType getType() const
get the algorithm type (static etc..)
void setOffset(SUMOTime offset)
Sets the offset of this tls.
The definition of a single phase of the logic.
PhaseDefinitionVector myPhases
The junction logic's storage for traffic light phase list.
void setPhaseState(int phaseIndex, int tlIndex, LinkState linkState)
Modifies the state for an existing phase (used by NETEDIT)
std::string state
The state definition.
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.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
void setPhaseMinDuration(int phaseIndex, SUMOTime duration)
SUMOTime myOffset
The tls program's offset.
void setStateLength(int numLinks, LinkState fill=LINKSTATE_TL_RED)
std::string name
option phase name
const std::string mySubID
The tls program's subid.
const std::vector< PhaseDefinition > & getPhases() const
Returns the phases.
int getNumLinks()
Returns the number of participating links.
bool operator!=(const PhaseDefinition &pd) const
Comparison operator.
NBTrafficLightLogic(const std::string &id, const std::string &subid, int noLinks, SUMOTime offset=0, TrafficLightType type=TLTYPE_STATIC)
Constructor.
~NBTrafficLightLogic()
Destructor.
void deletePhase(int index)
void setType(TrafficLightType type)
set the algorithm type (static etc..)
~PhaseDefinition()
Destructor.
PhaseDefinition(SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurArg, SUMOTime maxDurArg, const std::vector< int > &nextArg, const std::string &nameArg)
Constructor.
TrafficLightType myType
The algorithm type for the traffic light.
The link has red light (must brake)
A SUMO-compliant built logic for a traffic light.
void setPhaseNext(int phaseIndex, const std::vector< int > &next)
int myNumLinks
The number of participating links.
const std::string & getProgramID() const
Returns the ProgramID.
void setPhaseMaxDuration(int phaseIndex, SUMOTime duration)