Eclipse SUMO - Simulation of Urban MObility
MSDeterministicHiLevelTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2010-2024 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 /****************************************************************************/
18 // The class for deterministic high level traffic light logic
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
24 #include "MSSOTLPhasePolicy.h"
25 #include "MSSOTLPlatoonPolicy.h"
26 #include "MSSOTLMarchingPolicy.h"
27 #include "MSSOTLCongestionPolicy.h"
28 #include "MSSOTLPolicy3DStimulus.h"
29 
31 public:
32 
33 
34  //****************************************************
35 
46  MSDeterministicHiLevelTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id,
47  const std::string& programID, const Phases& phases, int step,
48  SUMOTime delay,
49  const Parameterised::Map& parameters);
50 
52 
59  void init(NLDetectorBuilder& nb);
60 
64  const std::string getLogicType() const {
65  return "DeterministicHighLevelTrafficLightLogic";
66  }
68 
69 protected:
70 
78 
86 
87  /*
88  * This member has to contain the switching logic for SOTL policies
89  */
90  int decideNextPhase();
91 
92  bool canRelease();
93 
94 
95  /*
96  * @return The average pheromone level regarding congestion on input lanes
97  */
99 
100  /*
101  * @return The average pheromone level regarding congestion on output lanes
102  */
104 
105 
106 
111  void decidePolicy();
112 
113  void choosePolicy(double mean_vSpeed_in, double mean_vSpeed_out);
114 
115 
116 };
long long int SUMOTime
Definition: GUI.h:35
std::set< std::string > MSLaneID_set
void choosePolicy(double mean_vSpeed_in, double mean_vSpeed_out)
const std::string getLogicType() const
Returns the type of the logic as a string.
void init(NLDetectorBuilder &nb)
Initialises the tls with sensors on incoming and outgoing lanes Sensors are built in the simulation a...
MSLaneID_set inputLanes
This pheronome is an indicator of congestion on input lanes. Its levels refer to the average speed of...
void decidePolicy()
Decide the current policy according to pheromone levels The decision reflects on currentPolicy value.
MSLaneID_set outputLanes
This pheromone is an indicator of congestion on output lanes. Its levels refer to the average speed o...
MSDeterministicHiLevelTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const Phases &phases, int step, SUMOTime delay, const Parameterised::Map &parameters)
Constructor without sensors passed.
A self-organizing high-level 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.
Builds detectors for microsim.
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45