26 const std::string& subid,
const Phases& phases,
int step,
27 SUMOTime delay,
const std::map<std::string, std::string>& parameters,
30 parameters), myPolicy(policy) {
33 "*** Intersection " +
id +
" will run using MSSOTL" 34 + policy->getName() +
"TrafficLightLogic ***");
40 const std::string& subid,
const Phases& phases,
int step,
41 SUMOTime delay,
const std::map<std::string, std::string>& parameters,
44 parameters, sensors), myPolicy(policy) {
MSSOTLPolicyBasedTrafficLightLogic(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, MSSOTLPolicy *policy)
Constructor without sensors passed.
std::string time2string(SUMOTime t)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual int decideNextPhase(SUMOTime elapsed, const MSPhaseDefinition *stage, int currentPhaseIndex, int phaseMaxCTS, bool thresholdPassed, bool pushButtonPressed, int vehicleCount)
const std::string & getID() const
Returns the id.
int getPhaseIndexWithMaxCTS()
virtual bool canRelease(SUMOTime elapsed, bool thresholdPassed, bool pushButtonPressed, const MSPhaseDefinition *stage, int vehicleCount)=0
A class that stores and controls tls and switching of their programs.
A self-organizing traffic light logic.
~MSSOTLPolicyBasedTrafficLightLogic()
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
SUMOTime getCurrentPhaseElapsed()
const MSPhaseDefinition & getCurrentPhaseDef() const
Returns the definition of the current phase.
int getCurrentPhaseIndex() const
Returns the current index within the program.
void inform(std::string msg, bool addType=true)
adds a new error to the list
Class for a low-level policy.
#define WRITE_MESSAGE(msg)
bool isPushButtonPressed()
int countVehicles(MSPhaseDefinition phase)