21 #ifndef NBTrafficLightLogic_h 22 #define NBTrafficLightLogic_h 79 duration(durationArg),
static const std::string ALLOWED_STATES
SUMOTime getOffset() const
Returns the offset of first switch.
void setPhaseMaxDuration(int phaseIndex, SUMOTime duration)
~PhaseDefinition()
Destructor.
int getNumLinks()
Returns the number of participating links.
void setPhaseState(int phaseIndex, int tlIndex, LinkState linkState)
Modifies the state for an existing phase (used by NETEDIT)
std::vector< PhaseDefinition > PhaseDefinitionVector
Definition of a vector of traffic light phases.
A SUMO-compliant built logic for a traffic light.
int myNumLinks
The number of participating links.
void deletePhase(int index)
const std::vector< PhaseDefinition > & getPhases() const
Returns the phases.
NBTrafficLightLogic(const std::string &id, const std::string &subid, int noLinks, SUMOTime offset=0, TrafficLightType type=TLTYPE_STATIC)
Constructor.
void setPhaseMinDuration(int phaseIndex, SUMOTime duration)
void setOffset(SUMOTime offset)
Sets the offset of this tls.
const std::string & getProgramID() const
Returns the ProgramID.
The definition of a single phase of the logic.
SUMOTime duration
The duration of the phase in s.
bool operator!=(const PhaseDefinition &pd) const
Comparison operator.
void setType(TrafficLightType type)
set the algorithm type (static etc..)
SUMOTime myOffset
The tls program's offset.
std::string state
The state definition.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
An upper class for objects with additional parameters.
Base class for objects which have an id.
SUMOTime getDuration() const
Returns the duration of the complete cycle.
void closeBuilding(bool checkVarDurations=true)
closes the building process
PhaseDefinition(SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurArg, SUMOTime maxDurArg)
Constructor.
TrafficLightType getType() const
get the algorithm type (static etc..)
const std::string mySubID
The tls program's subid.
~NBTrafficLightLogic()
Destructor.
The link has red light (must brake)
void setPhaseDuration(int phaseIndex, SUMOTime duration)
Modifies the duration for an existing phase (used by NETEDIT)
Static storage of an output device and its base (abstract) implementation.
void setStateLength(int numLinks, LinkState fill=LINKSTATE_TL_RED)
TrafficLightType myType
The algorithm type for the traffic light.
void addStep(SUMOTime duration, const std::string &state, int index=-1)
Adds a phase to the logic.
PhaseDefinitionVector myPhases
The junction logic's storage for traffic light phase list.
static const char allowedStatesInitializer[]
all allowed characters for phase state (see SUMOXMLDefinitions)
NBTrafficLightLogic & operator=(const NBTrafficLightLogic &s)
Invalidated assignment operator.