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 /****************************************************************************/
16 // The class for SOTL Policy-based logics
17 /****************************************************************************/
18 
19 #ifndef MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_
20 #define MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 //#define SWARM_DEBUG
29 #include "MSSOTLPolicy.h"
31 
42 public:
55  const std::string& id, const std::string& programID, const TrafficLightType logicType,
56  const Phases& phases, int step, SUMOTime delay,
57  const std::map<std::string, std::string>& parameters,
58  MSSOTLPolicy* policy);
59 
73  const std::string& id, const std::string& programID, const TrafficLightType logicType,
74  const Phases& phases, int step, SUMOTime delay,
75  const std::map<std::string, std::string>& parameters,
76  MSSOTLPolicy* policy, MSSOTLSensors* sensors);
77 
79 
81  return myPolicy;
82  }
83 
87  const std::string getLogicType() const {
88  return "policyBasedTrafficLightLogic";
89  }
91 
92 // virtual bool canRelease(SUMOTime elapsed, bool thresholdPassed, const MSPhaseDefinition* stage, int vehicleCount) throw ()=0;
93 
94 protected:
95 
96  /*
97  * @brief Contains the logic to decide the phase change
98  */
99  bool canRelease();
100 
101  /*
102  * This member has to contain the switching logic for SOTL policies
103  */
104  int decideNextPhase();
105 
106 private:
108 };
109 
110 #endif /* MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_ */
long long int SUMOTime
Definition: SUMOTime.h:35
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.
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.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Class for a low-level policy.
Definition: MSSOTLPolicy.h:65
TrafficLightType