22 #ifndef MSSOTLTrafficLightLogic_h 23 #define MSSOTLTrafficLightLogic_h 81 const std::string& subid,
const Phases& phases,
int step,
83 const std::map<std::string, std::string>& parameters);
97 const std::string& subid,
const Phases& phases,
int step,
99 const std::map<std::string, std::string>& parameters,
233 return (
int)targetPhasesCTS.size() - 1;
MSSOTLSensors * getSensors()
Builds detectors for microsim.
void init(NLDetectorBuilder &nb)
Initialises the tls with sensors on incoming and outgoing lanes Sensors are built in the simulation a...
static SUMOReal _2SUMOReal(const E *const data)
converts a char-type array into the SUMOReal value described by it
static bool _2bool(const E *const data)
converts a 0-terminated char-type array into the boolean value described by it
std::map< const std::string, std::vector< MSPushButton * > > PhasePushButtons
void resetCTS(int phaseStep)
std::map< int, SUMOTime > lastCheckForTargetPhase
SUMOReal getOutputSensorsLength()
bool isDecayThresholdActivated()
virtual int decideNextPhase()
int getPhaseIndexWithMaxCTS()
A class that stores and controls tls and switching of their programs.
SUMOTime duration
The duration of the phase.
A self-organizing traffic light logic.
MSSOTLSensors * mySensors
MSSOTLE2Sensors * getCountSensors()
Return the sensors that count the passage of vehicles in and out of the tl.
std::map< int, SUMOTime > targetPhasesCTS
PhasePushButtons m_pushButtons
SUMOReal getInputSensorsLength()
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
void updateDecayThreshold()
MSSOTLTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &subid, const Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > ¶meters)
Constructor without sensors passed.
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
~MSSOTLTrafficLightLogic()
Destructor.
SUMOTime getCurrentPhaseElapsed()
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
SUMOReal getSpeedThreshold()
SUMOReal getDecayConstant()
SUMOTime trySwitch()
Switches to the next phase.
virtual SUMOTime computeReturnTime()
int getTargetPhaseMaxLastSelection()
virtual bool canRelease()=0
A fixed traffic light logic.
The definition of a single phase of a tls logic.
bool isPushButtonPressed()
MSSOTLE2Sensors * myCountSensors
std::map< int, int > targetPhasesLastSelection
int countVehicles(MSPhaseDefinition phase)