35 parameters), myPolicy(policy) {
38 "*** Intersection " +
id +
" will run using MSSOTL"
39 + policy->
getName() +
"TrafficLightLogic ***");
49 parameters, sensors), myPolicy(policy) {
58 std::ostringstream str;
70 std::ostringstream str;
#define WRITE_MESSAGE(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
~MSSOTLPolicyBasedTrafficLightLogic()
MSSOTLPolicyBasedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const TrafficLightType logicType, const Phases &phases, int step, SUMOTime delay, const Parameterised::Map ¶meters, MSSOTLPolicy *policy)
Constructor without sensors passed.
Class for a low-level policy.
virtual bool canRelease(SUMOTime elapsed, bool thresholdPassed, bool pushButtonPressed, const MSPhaseDefinition *stage, int vehicleCount)=0
virtual int decideNextPhase(SUMOTime elapsed, const MSPhaseDefinition *stage, int currentPhaseIndex, int phaseMaxCTS, bool thresholdPassed, bool pushButtonPressed, int vehicleCount)
A self-organizing traffic light logic.
int getPhaseIndexWithMaxCTS()
int countVehicles(MSPhaseDefinition phase)
SUMOTime getCurrentPhaseElapsed()
bool isPushButtonPressed()
int getCurrentPhaseIndex() const override
Returns the current index within the program.
const MSPhaseDefinition & getCurrentPhaseDef() const override
Returns the definition of the current phase.
A class that stores and controls tls and switching of their programs.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
const std::string & getID() const
Returns the id.
std::map< std::string, std::string > Map
parameters map