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.
void closeBuilding()
closes the building process
std::vector< PhaseDefinition > PhaseDefinitionVector
Definition of a vector of traffic light phases.
A SUMO-compliant built logic for a traffic light.
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.
void setPhaseDuration(unsigned int phaseIndex, SUMOTime duration)
Modifies the duration for an existing phase (used by NETEDIT)
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.
void setPhaseState(unsigned int phaseIndex, unsigned int tlIndex, LinkState linkState)
Modifies the state for an existing phase (used by NETEDIT)
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.
unsigned int myNumLinks
The number of participating links.
void deletePhase(unsigned int index)
unsigned int getNumLinks()
Returns the number of participating links.
const std::string mySubID
The tls program's subid.
~NBTrafficLightLogic()
Destructor.
Static storage of an output device and its base (abstract) implementation.
NBTrafficLightLogic(const std::string &id, const std::string &subid, unsigned int noLinks, SUMOTime offset=0, TrafficLightType type=TLTYPE_STATIC)
Constructor.
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.