23 #ifndef MSAgentbasedTrafficLightLogic_h
24 #define MSAgentbasedTrafficLightLogic_h
49 class MSAgentbasedPhaseDefinition;
86 const std::string&
id,
const std::string& programID,
89 const std::map<std::string, std::string>& parameter);
void init(NLDetectorBuilder &nb)
Initialises the tls with information about incoming lanes.
PhaseValueMap myRawDetectorData
A map of the step of the greenphases and their detectorvalues for several (mumberofValues) cycles...
unsigned int numberOfValues
The number of detector values whivh is considered to make a decision.
An agentbased traffic light logic.
Builds detectors for microsim.
void lengthenCycleTime(unsigned int toLenghten)
lenghtens the actual cycle by an given value
void calculateDuration()
Calculates the duration for all real phases except intergreen phases.
std::deque< SUMOReal > ValueType
Definition of a map which stores the detector values of one single phase.
unsigned int nextStep()
Returns the index of the phase next to the given phase.
MSAgentbasedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const MSSimpleTrafficLightLogic::Phases &phases, unsigned int step, SUMOTime delay, const std::map< std::string, std::string > ¶meter)
Constructor.
~MSAgentbasedTrafficLightLogic()
Destructor.
A fixed traffic light logic.
A class that stores and controls tls and switching of their programs.
unsigned int findStepOfMaxValue() const
Returns the step of the phase with the longest Queue_Lengt_Ahead_Of_Traffic_Lights.
unsigned int tCycle
The cycletime of the trafficlight.
void aggregateRawData()
Aggregates the data of one phase, collected during different cycles.
MeanDataMap myMeanDetectorData
A map of the step of the greenphases and their aggregated detectordata.
std::map< unsigned int, SUMOReal > MeanDataMap
Definition of a map which stores the mean data of several (numberOfValues) cycles.
unsigned int tDecide
the interval in which the traffic light can make a decision
SUMOTime trySwitch(bool isActive)
Switches to the next phase.
void collectData()
Collects the traffic data.
unsigned int tSinceLastDecision
The number of cycles, before the last decision was made.
E2DetectorMap myE2Detectors
A map from lanes to E2 detectors lying on them.
std::map< MSLane *, MS_E2_ZS_CollectorOverLanes * > E2DetectorMap
Definition of a map from lanes to lane state detectors lying on them.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
std::map< unsigned int, ValueType > PhaseValueMap
Definition of a map which stores the step of the greenphases and their detector values.
void cutCycleTime(unsigned int toCut)
cuts the actual cycle by an given value
unsigned int findStepOfMinValue() const
Returns the step of the phase with the shortest Queue_Lengt_Ahead_Of_Traffic_Lights.
Representation of a lane in the micro simulation.
unsigned int stepOfLastDecision
Stores the step of the phase, when the last decision was made.