Eclipse 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-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <vector>
26 #include <stdlib.h>
27 #include <sstream>
28 
29 #include "MSSOTLPolicy.h"
31 
42 public:
54  const std::string& id, const std::string& programID,
55  const TrafficLightType logicType, const Phases& phases,
56  int step, SUMOTime delay,
57  const std::map<std::string, std::string>& parameters);
58 
71  const std::string& id, const std::string& programID,
72  const TrafficLightType logicType, const Phases& phases,
73  int step, SUMOTime delay,
74  const std::map<std::string, std::string>& parameters,
75  MSSOTLSensors* sensors);
77 
82  void init(NLDetectorBuilder& nb);
83 
84  /*
85  * \brief Adds a low-level policy to this high-level tll.
86  * \param[in] policy The low-level policy to be added.
87  */
88  void addPolicy(MSSOTLPolicy* policy);
89 
90  /*
91  * \brief Activates the given low-level policy.
92  * \param[in] policy The low-level policy to be activated.
93  */
94  void activate(MSSOTLPolicy* policy);
95 
96 protected:
97  virtual void decidePolicy() = 0;
98 
99 protected:
100  std::vector<MSSOTLPolicy*> myPolicies;
102 
103 };
104 
long long int SUMOTime
Definition: SUMOTime.h:32
TrafficLightType
A self-organizing high-level traffic light logic.
std::vector< MSSOTLPolicy * > myPolicies
MSSOTLHiLevelTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const TrafficLightType logicType, const Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > &parameters)
Constructor without sensors passed.
void init(NLDetectorBuilder &nb)
Initialises the tls.
Class for a low-level policy.
Definition: MSSOTLPolicy.h:61
A self-organizing traffic light logic.
A class that stores and controls tls and switching of their programs.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Builds detectors for microsim.