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.
int getCurrentPhaseIndex() const
Returns the current index within the program.
void updateCurrentPhase()
updates the current phase of the signal
SUMOTime getOffsetFromIndex(int index) const
Returns the position (start of a phase during a cycle) from of a given step.
int getPhaseNumber() const
Returns the number of phases.
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...
const MSPhaseDefinition & getPhase(int givenstep) const
Returns the definition of the phase from the given position within the plan.
#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.
int getIndexFromOffset(SUMOTime offset) const
Returns the step (the phasenumber) of a given position of the cycle.
SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const
Returns the index of the logic at the given simulation step.
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.
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...
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
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.
const std::string getLogicType() const
Returns the type of the logic as a string.
const Phases & getPhases() const
Returns the phases of this tls program.
std::string getAppropriateState()
returns the state of the signal that actually required
The parent class for traffic light logics.
MSPhaseDefinition myCurrentPhase
The current phase.
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.
~MSRailSignal()
Destructor.