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 /****************************************************************************/
14 /****************************************************************************/
16 
18  const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases,
19  int step, SUMOTime delay,
20  const std::map<std::string, std::string>& parameters) :
21  MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
22  parameters) {
23  // Setting default values
24 
25 }
26 
28  const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases,
29  int step, SUMOTime delay,
30  const std::map<std::string, std::string>& parameters,
31  MSSOTLSensors* sensors) :
32  MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
33  parameters, sensors) {
34  // Setting default values
35 
36 }
37 
39  for (int i = 0; i < (int)policies.size(); i++) {
40  delete (policies[i]);
41  }
42 }
43 
45  policies.push_back(policy);
46 }
47 
50 }
51 
53  currentPolicy = policy;
54 }
MSSOTLTrafficLightLogic
A self-organizing traffic light logic.
Definition: MSSOTLTrafficLightLogic.h:58
MSSOTLPolicy
Class for a low-level policy.
Definition: MSSOTLPolicy.h:64
MSTrafficLightLogic::Phases
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Definition: MSTrafficLightLogic.h:61
TrafficLightType
TrafficLightType
Definition: SUMOXMLDefinitions.h:1197
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSSOTLHiLevelTrafficLightLogic.h
MSSOTLHiLevelTrafficLightLogic::~MSSOTLHiLevelTrafficLightLogic
~MSSOTLHiLevelTrafficLightLogic()
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:38
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:17
MSSOTLHiLevelTrafficLightLogic::currentPolicy
MSSOTLPolicy * currentPolicy
Definition: MSSOTLHiLevelTrafficLightLogic.h:118
MSSOTLHiLevelTrafficLightLogic::addPolicy
void addPolicy(MSSOTLPolicy *policy)
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:44
MSSOTLSensors
Definition: MSSOTLSensors.h:32
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:59
MSSOTLHiLevelTrafficLightLogic::init
void init(NLDetectorBuilder &nb)
Initialises the tls.
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:48
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:121
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:55
MSSOTLHiLevelTrafficLightLogic::activate
void activate(MSSOTLPolicy *policy)
Definition: MSSOTLHiLevelTrafficLightLogic.cpp:52
MSSOTLHiLevelTrafficLightLogic::policies
std::vector< MSSOTLPolicy * > policies
Definition: MSSOTLHiLevelTrafficLightLogic.h:117