Eclipse SUMO - Simulation of Urban MObility
MSSOTLHiLevelTrafficLightLogic.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-2020 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 /****************************************************************************/
18 /****************************************************************************/
20 
22  const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases,
23  int step, SUMOTime delay,
24  const std::map<std::string, std::string>& parameters) :
25  MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
26  parameters) {
27  // Setting default values
28 
29 }
30 
32  const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases,
33  int step, SUMOTime delay,
34  const std::map<std::string, std::string>& parameters,
35  MSSOTLSensors* sensors) :
36  MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
37  parameters, sensors) {
38  // Setting default values
39 
40 }
41 
43  for (int i = 0; i < (int)policies.size(); i++) {
44  delete (policies[i]);
45  }
46 }
47 
49  policies.push_back(policy);
50 }
51 
54 }
55 
57  currentPolicy = policy;
58 }
long long int SUMOTime
Definition: SUMOTime.h:31
TrafficLightType
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:63
A self-organizing traffic light logic.
void init(NLDetectorBuilder &nb)
Initialises the tls with sensors on incoming and outgoing lanes Sensors are built in the simulation a...
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.