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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // The class for SOTL Policy-based logics
19 /****************************************************************************/
20 
21 #ifndef MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_
22 #define MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 //#define SWARM_DEBUG
35 #include "MSSOTLPolicy.h"
37 
48 public:
60  const std::string& id, const std::string& subid,
61  const Phases& phases, int step, SUMOTime delay,
62  const std::map<std::string, std::string>& parameters,
63  MSSOTLPolicy* policy) throw();
64 
77  const std::string& id, const std::string& subid,
78  const Phases& phases, int step, SUMOTime delay,
79  const std::map<std::string, std::string>& parameters,
80  MSSOTLPolicy* policy, MSSOTLSensors* sensors) throw();
81 
83 
85  return myPolicy;
86  }
87 
91  const std::string getLogicType() const {
92  return "policyBasedTrafficLightLogic";
93  }
95 
96 // virtual bool canRelease(SUMOTime elapsed, bool thresholdPassed, const MSPhaseDefinition* stage, int vehicleCount) throw ()=0;
97 
98 protected:
99 
100  /*
101  * @brief Contains the logic to decide the phase change
102  */
103  bool canRelease() throw();
104 
105  /*
106  * This member has to contain the switching logic for SOTL policies
107  */
108  int decideNextPhase();
109 
110 private:
112 };
113 
114 #endif /* MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_ */
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 > &parameters, MSSOTLPolicy *policy)
Constructor without sensors passed.
A class that stores and controls tls and switching of their programs.
A self-organizing traffic light logic based on a particular policy.
A self-organizing traffic light logic.
const std::string getLogicType() const
Returns the type of the logic as a string.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Class for a low-level policy.
Definition: MSSOTLPolicy.h:71
long long int SUMOTime
Definition: TraCIDefs.h:51