67 const std::string&
id,
const std::string& programID,
71 const std::map<std::string, std::string>& parameters);
124 return "simpleTrafficLightLogic";
The simulated network and simulation perfomer.
The definition of a single phase of a tls logic.
A fixed traffic light logic.
SUMOTime getLatest() const
the maximum duratin for keeping the current phase when considering 'latestEnd'
Phases myPhases
The list of phases this logic uses.
MSSimpleTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const SUMOTime offset, const TrafficLightType logicType, const Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > ¶meters)
Constructor.
virtual void saveState(OutputDevice &) const
Saves the current tls states into the given stream.
virtual SUMOTime mapTimeInCycle(SUMOTime t) const
map the given time into the current cycle
SUMOTime getEarliest(SUMOTime prevStart) const
the minimum duration for keeping the current phase when considering 'earliestEnd'
void setPhases(const Phases &phases, int index)
Replaces the phases and set the phase index.
int getIndexFromOffset(SUMOTime offset) const
Returns the step (the phasenumber) of a given position of the cycle.
int getPhaseNumber() const
Returns the number of phases.
~MSSimpleTrafficLightLogic()
Destructor.
int getCurrentPhaseIndex() const
Returns the current index within the program.
SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const
Returns the index of the logic at the given simulation step.
SUMOTime getOffsetFromIndex(int index) const
Returns the position (start of a phase during a cycle) from of a given step.
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
const MSPhaseDefinition & getPhase(int givenstep) const
Returns the definition of the phase from the given position within the plan.
const Phases & getPhases() const
Returns the phases of this tls program.
int myStep
The current step.
bool myCoordinated
whether coordination parameters earliestEnd, latestEnd are
void deletePhases()
frees memory responsibilities
virtual void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, int step, SUMOTime stepDuration)
Changes the current phase and her duration.
const std::string getLogicType() const
Returns the type of the logic as a string.
virtual SUMOTime trySwitch()
Switches to the next phase.
A class that stores and controls tls and switching of their programs.
The parent class for traffic light logics.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Static storage of an output device and its base (abstract) implementation.