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 /****************************************************************************/
MSDeterministicHiLevelTrafficLightLogic::~MSDeterministicHiLevelTrafficLightLogic
~MSDeterministicHiLevelTrafficLightLogic()
Definition: MSDeterministicHiLevelTrafficLightLogic.cpp:34
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:38
MSDeterministicHiLevelTrafficLightLogic
Definition: MSDeterministicHiLevelTrafficLightLogic.h:34
MSDeterministicHiLevelTrafficLightLogic::decidePolicy
void decidePolicy()
Decide the current policy according to pheromone levels The decision reflects on currentPolicy value.
Definition: MSDeterministicHiLevelTrafficLightLogic.cpp:132
MSTrafficLightLogic::Phases
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Definition: MSTrafficLightLogic.h:62
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
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:20
MSSOTLPolicy3DStimulus.h
MSSOTLHiLevelTrafficLightLogic
A self-organizing high-level traffic light logic.
Definition: MSSOTLHiLevelTrafficLightLogic.h:45
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:81
MSLaneID_set
std::set< std::string > MSLaneID_set
Definition: MSSOTLDefinitions.h:74
MSSOTLHiLevelTrafficLightLogic.h
MSDeterministicHiLevelTrafficLightLogic::decideNextPhase
int decideNextPhase()
Definition: MSDeterministicHiLevelTrafficLightLogic.cpp:76
MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes
double getMeanSpeedForInputLanes()
Definition: MSDeterministicHiLevelTrafficLightLogic.cpp:96
MSDeterministicHiLevelTrafficLightLogic::getLogicType
const std::string getLogicType() const
Returns the type of the logic as a string.
Definition: MSDeterministicHiLevelTrafficLightLogic.h:68
MSDeterministicHiLevelTrafficLightLogic::canRelease
bool canRelease()
Definition: MSDeterministicHiLevelTrafficLightLogic.cpp:172
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:89
MSSOTLMarchingPolicy.h
MSSOTLCongestionPolicy.h
config.h
SwarmDebug.h
MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes
double getMeanSpeedForOutputLanes()
Definition: MSDeterministicHiLevelTrafficLightLogic.cpp:114
MSDeterministicHiLevelTrafficLightLogic::choosePolicy
void choosePolicy(double mean_vSpeed_in, double mean_vSpeed_out)
Definition: MSDeterministicHiLevelTrafficLightLogic.cpp:151
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:60
MSSOTLPhasePolicy.h
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:56