SUMO - Simulation of Urban MObility
MSSOTLHiLevelTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSSOTLTrafficLightLogic_H
23 #define MSSOTLTrafficLightLogic_H
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 //#define SWARM_DEBUG
36 #include <vector>
37 #include "MSSOTLPolicy.h"
38 #include <stdlib.h>
39 #include <sstream>
40 
42 
53 public:
65  const std::string& id, const std::string& subid, const Phases& phases,
66  int step, SUMOTime delay,
67  const std::map<std::string, std::string>& parameters);
68 
81  const std::string& id, const std::string& subid, const Phases& phases,
82  int step, SUMOTime delay,
83  const std::map<std::string, std::string>& parameters,
84  MSSOTLSensors* sensors);
86 
90  std::vector<MSSOTLPolicy*>& getPolicies() {
91  return policies;
92  }
97  return currentPolicy;
98  }
99 
104  void init(NLDetectorBuilder& nb) throw(ProcessError);
105 
106  /*
107  * \brief Adds a low-level policy to this high-level tll.
108  * \param[in] policy The low-level policy to be added.
109  */
110  void addPolicy(MSSOTLPolicy* policy);
111 
112  /*
113  * \brief Activates the given low-level policy.
114  * \param[in] policy The low-level policy to be activated.
115  */
116  void activate(MSSOTLPolicy* policy);
117 
118 protected:
119  virtual void decidePolicy() = 0;
120 
121 private:
122 
123  std::vector<MSSOTLPolicy*> policies;
125 
126 };
127 
128 #endif
Builds detectors for microsim.
long long int SUMOTime
Definition: SUMOTime.h:43
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:72