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