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.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 deterministic high level traffic light logic
16 /****************************************************************************/
17 #ifndef MSDeterministicHiLevelTrafficLightLogic_h
18 #define MSDeterministicHiLevelTrafficLightLogic_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #define SWARM_DEBUG
28 #include "MSSOTLPhasePolicy.h"
29 #include "MSSOTLPlatoonPolicy.h"
30 #include "MSSOTLMarchingPolicy.h"
31 #include "MSSOTLCongestionPolicy.h"
32 #include "MSSOTLPolicy3DStimulus.h"
33 
35 public:
36 
37 
38  //****************************************************
39 
50  MSDeterministicHiLevelTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id,
51  const std::string& programID, const Phases& phases, int step,
52  SUMOTime delay,
53  const std::map<std::string, std::string>& parameters);
54 
56 
63  void init(NLDetectorBuilder& nb);
64 
68  const std::string getLogicType() const {
69  return "DeterministicHighLevelTrafficLightLogic";
70  }
72 
73 protected:
74 
82 
90 
91  /*
92  * This member has to contain the switching logic for SOTL policies
93  */
94  int decideNextPhase();
95 
96  bool canRelease();
97 
98 
99  /*
100  * @return The average pheromone level regarding congestion on input lanes
101  */
102  double getMeanSpeedForInputLanes();
103 
104  /*
105  * @return The average pheromone level regarding congestion on output lanes
106  */
108 
109 
110 
115  void decidePolicy();
116 
117  void choosePolicy(double mean_vSpeed_in, double mean_vSpeed_out);
118 
119 
120 };
121 
122 #endif
123 /****************************************************************************/
void choosePolicy(double mean_vSpeed_in, double mean_vSpeed_out)
void decidePolicy()
Decide the current policy according to pheromone levels The decision reflects on currentPolicy value...
MSLaneID_set inputLanes
This pheronome is an indicator of congestion on input lanes. Its levels refer to the average speed of...
Builds detectors for microsim.
long long int SUMOTime
Definition: SUMOTime.h:35
std::set< std::string > MSLaneID_set
void init(NLDetectorBuilder &nb)
Initialises the tls with sensors on incoming and outgoing lanes Sensors are built in the simulation a...
const std::string getLogicType() const
Returns the type of the logic as a string.
A self-organizing high-level traffic light logic.
A class that stores and controls tls and switching of their programs.
MSLaneID_set outputLanes
This pheromone is an indicator of congestion on output lanes. Its levels refer to the average speed o...
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
MSDeterministicHiLevelTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > &parameters)
Constructor without sensors passed.