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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 /****************************************************************************/
17 
19  const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases,
20  int step, SUMOTime delay,
21  const std::map<std::string, std::string>& parameters) :
22  MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
23  parameters) {
24  // Setting default values
25 
26 }
27 
29  const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases,
30  int step, SUMOTime delay,
31  const std::map<std::string, std::string>& parameters,
32  MSSOTLSensors* sensors) :
33  MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
34  parameters, sensors) {
35  // Setting default values
36 
37 }
38 
40  for (int i = 0; i < (int)policies.size(); i++) {
41  delete (policies[i]);
42  }
43 }
44 
46  policies.push_back(policy);
47 }
48 
51 }
52 
54  currentPolicy = policy;
55 }
MSSOTLTrafficLightLogic
A self-organizing traffic light logic.
Definition: MSSOTLTrafficLightLogic.h:59
MSSOTLPolicy
Class for a low-level policy.
Definition: MSSOTLPolicy.h:65
MSTrafficLightLogic::Phases
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Definition: MSTrafficLightLogic.h:62
TrafficLightType
TrafficLightType
Definition: SUMOXMLDefinitions.h:1192
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
MSSOTLHiLevelTrafficLightLogic.h
MSSOTLHiLevelTrafficLightLogic::~MSSOTLHiLevelTrafficLightLogic
~MSSOTLHiLevelTrafficLightLogic()
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:39
MSSOTLHiLevelTrafficLightLogic::MSSOTLHiLevelTrafficLightLogic
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.
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:18
MSSOTLHiLevelTrafficLightLogic::currentPolicy
MSSOTLPolicy * currentPolicy
Definition: MSSOTLHiLevelTrafficLightLogic.h:119
MSSOTLHiLevelTrafficLightLogic::addPolicy
void addPolicy(MSSOTLPolicy *policy)
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:45
MSSOTLSensors
Definition: MSSOTLSensors.h:33
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:60
MSSOTLHiLevelTrafficLightLogic::init
void init(NLDetectorBuilder &nb)
Initialises the tls.
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:49
MSSOTLTrafficLightLogic::init
void init(NLDetectorBuilder &nb)
Initialises the tls with sensors on incoming and outgoing lanes Sensors are built in the simulation a...
Definition: MSSOTLTrafficLightLogic.cpp:122
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:56
MSSOTLHiLevelTrafficLightLogic::activate
void activate(MSSOTLPolicy *policy)
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:53
MSSOTLHiLevelTrafficLightLogic::policies
std::vector< MSSOTLPolicy * > policies
Definition: MSSOTLHiLevelTrafficLightLogic.h:118