21 #ifndef MSRailSignal_h 22 #define MSRailSignal_h 63 const std::string&
id,
const std::string& subid,
64 const std::map<std::string, std::string>& parameters);
std::map< MSLink *, std::vector< MSLane * > > myAfferentBlocks
A map that maps a link from the junction to its vector of lanes leading from a previous signal to thi...
Builds detectors for microsim.
void updateCurrentPhase()
updates the current phase of the signal
const MSPhaseDefinition & getPhase(int givenstep) const
Returns the definition of the phase from the given position within the plan.
void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, int step, SUMOTime stepDuration)
Changes the current phase and her duration.
std::map< MSLane *, std::vector< MSLink * > > myLinksToLane
A map that maps an outgoing lane from the junction to its set of links that lead to this lane...
int getIndexFromOffset(SUMOTime offset) const
Returns the step (the phasenumber) of a given position of the cycle.
#define UNUSED_PARAMETER(x)
std::map< MSLink *, int > myLinkIndices
A map that maps a link to its link index.
A class that stores and controls tls and switching of their programs.
std::vector< MSLane * > myOutgoingLanes
The set of lanes going out from the junction.
void init(NLDetectorBuilder &nb)
Initialises the rail signal with information about adjacent rail signals.
Phases myPhases
The list of phases this logic uses.
const Phases & getPhases() const
Returns the phases of this tls program.
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
std::map< MSLane *, std::vector< const MSLane * > > mySucceedingBlocks
A map that maps an outgoing lane from the junction to its vector of lanes leading to the next signal...
int getPhaseNumber() const
Returns the number of phases.
const std::string getLogicType() const
Returns the type of the logic as a string.
SUMOTime trySwitch()
Switches to the next phase.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
void adaptLinkInformationFrom(const MSTrafficLightLogic &logic)
Applies information about controlled links and lanes from the given logic.
SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const
Returns the index of the logic at the given simulation step.
std::string getAppropriateState()
returns the state of the signal that actually required
The parent class for traffic light logics.
MSPhaseDefinition myCurrentPhase
The current phase.
SUMOTime getOffsetFromIndex(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.
MSRailSignal(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &subid, const std::map< std::string, std::string > ¶meters)
Constructor.
int getCurrentPhaseIndex() const
Returns the current index within the program.
~MSRailSignal()
Destructor.