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-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 /****************************************************************************/
17 // The class for deterministic high level traffic light logic
18 /****************************************************************************/
19 #ifndef MSDeterministicHiLevelTrafficLightLogic_h
20 #define MSDeterministicHiLevelTrafficLightLogic_h
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #define SWARM_DEBUG
34 #include "MSSOTLPhasePolicy.h"
35 #include "MSSOTLPlatoonPolicy.h"
36 #include "MSSOTLMarchingPolicy.h"
37 #include "MSSOTLCongestionPolicy.h"
38 #include "MSSOTLPolicy3DStimulus.h"
39 
41 public:
42 
43 
44  //****************************************************
45 
56  MSDeterministicHiLevelTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id,
57  const std::string& subid, const Phases& phases, int step,
58  SUMOTime delay,
59  const std::map<std::string, std::string>& parameters);
60 
62 
69  void init(NLDetectorBuilder& nb) throw(ProcessError);
70 
74  const std::string getLogicType() const {
75  return "DeterministicHighLevelTrafficLightLogic";
76  }
78 
79 protected:
80 
88 
96 
97  /*
98  * This member has to contain the switching logic for SOTL policies
99  */
100  int decideNextPhase();
101 
102  bool canRelease();
103 
104 
105  /*
106  * @return The average pheromone level regarding congestion on input lanes
107  */
108  double getMeanSpeedForInputLanes();
109 
110  /*
111  * @return The average pheromone level regarding congestion on output lanes
112  */
114 
115 
116 
121  void decidePolicy();
122 
123  void choosePolicy(double mean_vSpeed_in, double mean_vSpeed_out);
124 
125 
126 };
127 
128 #endif
129 /****************************************************************************/
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.
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 &subid, const Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > &parameters)
Constructor without sensors passed.
long long int SUMOTime
Definition: TraCIDefs.h:51