22 #ifndef NBTrafficLightLogic_h 23 #define NBTrafficLightLogic_h 78 : duration(durationArg), state(stateArg) { }
static const std::string ALLOWED_STATES
TrafficLightType getType() const
get the algorithm type (static etc..)
const std::string & getProgramID() const
Returns the ProgramID.
~PhaseDefinition()
Destructor.
int getNumLinks()
Returns the number of participating links.
void closeBuilding()
closes the building process
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)
NBTrafficLightLogic(const std::string &id, const std::string &subid, int noLinks, SUMOTime offset=0, TrafficLightType type=TLTYPE_STATIC)
Constructor.
void setOffset(SUMOTime offset)
Sets the offset of this tls.
The definition of a single phase of the logic.
SUMOTime duration
The duration of the phase in s.
void setType(TrafficLightType type)
set the algorithm type (static etc..)
const std::vector< PhaseDefinition > & getPhases() const
Returns the phases.
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.
SUMOTime getDuration() const
Returns the duration of the complete cycle.
Base class for objects which have an id.
SUMOTime getOffset() const
Returns the offset of first switch.
const std::string mySubID
The tls program's subid.
~NBTrafficLightLogic()
Destructor.
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.
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.
PhaseDefinition(SUMOTime durationArg, const std::string &stateArg)
Constructor.
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.
bool operator!=(const PhaseDefinition &pd) const
Comparison operator.