24 #ifndef MSSimpleTrafficLightLogic_h
25 #define MSSimpleTrafficLightLogic_h
70 const std::string&
id,
const std::string& subid,
72 const std::map<std::string, std::string>& parameters);
185 unsigned int step,
SUMOTime stepDuration);
void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, unsigned int step, SUMOTime stepDuration)
Changes the current phase and her duration.
unsigned int getPhaseNumber() const
Returns the number of phases.
unsigned int getIndexFromOffset(SUMOTime offset) const
Returns the step (the phasenumber) of a given position of the cycle.
unsigned int myStep
The current step.
const Phases & getPhases() const
Returns the phases of this tls program.
SUMOTime trySwitch(bool isActive)
Switches to the next phase.
Phases myPhases
The list of phases this logic uses.
SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const
Returns the index of the logic at the given simulation step.
A fixed traffic light logic.
A class that stores and controls tls and switching of their programs.
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
const MSPhaseDefinition & getPhase(unsigned int givenstep) const
Returns the definition of the phase from the given position within the plan.
void deletePhases()
frees memory responsibilities
MSSimpleTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &subid, const Phases &phases, unsigned int step, SUMOTime delay, const std::map< std::string, std::string > ¶meters)
Constructor.
~MSSimpleTrafficLightLogic()
Destructor.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
unsigned int getCurrentPhaseIndex() const
Returns the current index within the program.
The parent class for traffic light logics.
void setPhases(const Phases &phases, unsigned int index)
Replaces the phases and set the phase index.
SUMOTime getOffsetFromIndex(unsigned int index) const
Returns the position (start of a phase during a cycle) from of a given step.
The definition of a single phase of a tls logic.