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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // The class for SOTL Policy-based logics
20 /****************************************************************************/
21 
22 #pragma once
23 #include <config.h>
24 
25 //#define SWARM_DEBUG
27 #include "MSSOTLPolicy.h"
29 
40 public:
53  const std::string& id, const std::string& programID, const TrafficLightType logicType,
54  const Phases& phases, int step, SUMOTime delay,
55  const std::map<std::string, std::string>& parameters,
56  MSSOTLPolicy* policy);
57 
71  const std::string& id, const std::string& programID, const TrafficLightType logicType,
72  const Phases& phases, int step, SUMOTime delay,
73  const std::map<std::string, std::string>& parameters,
74  MSSOTLPolicy* policy, MSSOTLSensors* sensors);
75 
77 
79  return myPolicy;
80  }
81 
85  const std::string getLogicType() const {
86  return "policyBasedTrafficLightLogic";
87  }
89 
90 // virtual bool canRelease(SUMOTime elapsed, bool thresholdPassed, const MSPhaseDefinition* stage, int vehicleCount) throw ()=0;
91 
92 protected:
93 
94  /*
95  * @brief Contains the logic to decide the phase change
96  */
97  bool canRelease();
98 
99  /*
100  * This member has to contain the switching logic for SOTL policies
101  */
102  int decideNextPhase();
103 
104 private:
106 };
107 
long long int SUMOTime
Definition: SUMOTime.h:31
TrafficLightType
A self-organizing traffic light logic based on a particular policy.
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.
const std::string getLogicType() const
Returns the type of the logic as a string.
Class for a low-level policy.
Definition: MSSOTLPolicy.h:63
A self-organizing traffic light logic.
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.