SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MSDeterministicHiLevelTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The class for deterministic high level traffic light logic
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright 2001-2009 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSDeterministicHiLevelTrafficLightLogic_h
21 #define MSDeterministicHiLevelTrafficLightLogic_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #define SWARM_DEBUG
35 #include "MSSOTLPhasePolicy.h"
36 #include "MSSOTLPlatoonPolicy.h"
37 #include "MSSOTLMarchingPolicy.h"
38 #include "MSSOTLCongestionPolicy.h"
39 #include "MSSOTLPolicy3DStimulus.h"
40 
42 public:
43 
44 
45  //****************************************************
46 
57  MSDeterministicHiLevelTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id,
58  const std::string& subid, const Phases& phases, int step,
59  SUMOTime delay,
60  const std::map<std::string, std::string>& parameters);
61 
63 
70  void init(NLDetectorBuilder& nb) throw(ProcessError);
71 
75  const std::string getLogicType() const {
76  return "DeterministicHighLevelTrafficLightLogic";
77  }
79 
80 protected:
81 
89 
97 
98  /*
99  * This member has to contain the switching logic for SOTL policies
100  */
101  int decideNextPhase();
102 
103  bool canRelease();
104 
105 
106  /*
107  * @return The average pheromone level regarding congestion on input lanes
108  */
110 
111  /*
112  * @return The average pheromone level regarding congestion on output lanes
113  */
115 
116 
117 
122  void decidePolicy();
123 
124  void choosePolicy(SUMOReal mean_vSpeed_in, SUMOReal mean_vSpeed_out);
125 
126 
127 };
128 
129 #endif
130 /****************************************************************************/
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:43
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...
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.
const std::string getLogicType() const
Returns the type of the logic as a string.
#define SUMOReal
Definition: config.h:214
void choosePolicy(SUMOReal mean_vSpeed_in, SUMOReal mean_vSpeed_out)