Eclipse SUMO - Simulation of Urban MObility
MSSOTLPolicyBasedTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2010-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The class for SOTL Policy-based logics
16 /****************************************************************************/
17 
18 #ifndef MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_
19 #define MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 //#define SWARM_DEBUG
28 #include "MSSOTLPolicy.h"
30 
41 public:
54  const std::string& id, const std::string& programID, const TrafficLightType logicType,
55  const Phases& phases, int step, SUMOTime delay,
56  const std::map<std::string, std::string>& parameters,
57  MSSOTLPolicy* policy);
58 
72  const std::string& id, const std::string& programID, const TrafficLightType logicType,
73  const Phases& phases, int step, SUMOTime delay,
74  const std::map<std::string, std::string>& parameters,
75  MSSOTLPolicy* policy, MSSOTLSensors* sensors);
76 
78 
80  return myPolicy;
81  }
82 
86  const std::string getLogicType() const {
87  return "policyBasedTrafficLightLogic";
88  }
90 
91 // virtual bool canRelease(SUMOTime elapsed, bool thresholdPassed, const MSPhaseDefinition* stage, int vehicleCount) throw ()=0;
92 
93 protected:
94 
95  /*
96  * @brief Contains the logic to decide the phase change
97  */
98  bool canRelease();
99 
100  /*
101  * This member has to contain the switching logic for SOTL policies
102  */
103  int decideNextPhase();
104 
105 private:
107 };
108 
109 #endif /* MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_ */
MSSOTLPolicyBasedTrafficLightLogic::canRelease
bool canRelease()
Definition: MSSOTLPolicyBasedTrafficLightLogic.cpp:58
MSSOTLTrafficLightLogic
A self-organizing traffic light logic.
Definition: MSSOTLTrafficLightLogic.h:58
MSSOTLPolicy
Class for a low-level policy.
Definition: MSSOTLPolicy.h:64
MSSOTLPolicyBasedTrafficLightLogic::MSSOTLPolicyBasedTrafficLightLogic
MSSOTLPolicyBasedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const TrafficLightType logicType, const Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > &parameters, MSSOTLPolicy *policy)
Constructor without sensors passed.
Definition: MSSOTLPolicyBasedTrafficLightLogic.cpp:20
MSSOTLPolicyBasedTrafficLightLogic::getLogicType
const std::string getLogicType() const
Returns the type of the logic as a string.
Definition: MSSOTLPolicyBasedTrafficLightLogic.h:86
MSSOTLPolicyBasedTrafficLightLogic::myPolicy
MSSOTLPolicy * myPolicy
Definition: MSSOTLPolicyBasedTrafficLightLogic.h:106
MSTrafficLightLogic::Phases
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Definition: MSTrafficLightLogic.h:61
TrafficLightType
TrafficLightType
Definition: SUMOXMLDefinitions.h:1197
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSSOTLPolicyBasedTrafficLightLogic::~MSSOTLPolicyBasedTrafficLightLogic
~MSSOTLPolicyBasedTrafficLightLogic()
Definition: MSSOTLPolicyBasedTrafficLightLogic.cpp:43
MSSOTLPolicyBasedTrafficLightLogic
A self-organizing traffic light logic based on a particular policy.
Definition: MSSOTLPolicyBasedTrafficLightLogic.h:40
MSSOTLPolicyBasedTrafficLightLogic::getPolicy
MSSOTLPolicy * getPolicy()
Definition: MSSOTLPolicyBasedTrafficLightLogic.h:79
MSSOTLPolicy.h
MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase
int decideNextPhase()
Definition: MSSOTLPolicyBasedTrafficLightLogic.cpp:47
MSSOTLTrafficLightLogic.h
MSSOTLSensors
Definition: MSSOTLSensors.h:32
config.h
SwarmDebug.h
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:59