SUMO - Simulation of Urban MObility
MSSOTLHiLevelTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-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 /****************************************************************************/
20 /****************************************************************************/
21 #ifndef MSSOTLTrafficLightLogic_H
22 #define MSSOTLTrafficLightLogic_H
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 //#define SWARM_DEBUG
35 #include <vector>
36 #include "MSSOTLPolicy.h"
37 #include <stdlib.h>
38 #include <sstream>
39 
41 
52 public:
64  const std::string& id, const std::string& subid, const Phases& phases,
65  int step, SUMOTime delay,
66  const std::map<std::string, std::string>& parameters);
67 
80  const std::string& id, const std::string& subid, const Phases& phases,
81  int step, SUMOTime delay,
82  const std::map<std::string, std::string>& parameters,
83  MSSOTLSensors* sensors);
85 
89  std::vector<MSSOTLPolicy*>& getPolicies() {
90  return policies;
91  }
96  return currentPolicy;
97  }
98 
103  void init(NLDetectorBuilder& nb) throw(ProcessError);
104 
105  /*
106  * \brief Adds a low-level policy to this high-level tll.
107  * \param[in] policy The low-level policy to be added.
108  */
109  void addPolicy(MSSOTLPolicy* policy);
110 
111  /*
112  * \brief Activates the given low-level policy.
113  * \param[in] policy The low-level policy to be activated.
114  */
115  void activate(MSSOTLPolicy* policy);
116 
117 protected:
118  virtual void decidePolicy() = 0;
119 
120 private:
121 
122  std::vector<MSSOTLPolicy*> policies;
124 
125 };
126 
127 #endif
Builds detectors for microsim.
void init(NLDetectorBuilder &nb)
Initialises the tls.
A self-organizing high-level traffic light logic.
A class that stores and controls tls and switching of their programs.
A self-organizing traffic light logic.
std::vector< MSSOTLPolicy * > & getPolicies()
Returns the vector of the low-level policies used by this high-level tll.
MSSOTLPolicy * getCurrentPolicy()
Returns the low-level policy currently selected by this high-level tll.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
MSSOTLHiLevelTrafficLightLogic(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.
Class for a low-level policy.
Definition: MSSOTLPolicy.h:71
long long int SUMOTime
Definition: TraCIDefs.h:51