Eclipse SUMO - Simulation of Urban MObility
MSSOTLPolicyBasedTrafficLightLogic.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2010-2023 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/****************************************************************************/
19// The class for SOTL Policy-based logics
20/****************************************************************************/
21
22#pragma once
23#include <config.h>
24
25#include "MSSOTLPolicy.h"
27
38public:
51 const std::string& id, const std::string& programID, const TrafficLightType logicType,
52 const Phases& phases, int step, SUMOTime delay,
53 const Parameterised::Map& parameters,
54 MSSOTLPolicy* policy);
55
69 const std::string& id, const std::string& programID, const TrafficLightType logicType,
70 const Phases& phases, int step, SUMOTime delay,
71 const Parameterised::Map& parameters,
72 MSSOTLPolicy* policy, MSSOTLSensors* sensors);
73
75
77 return myPolicy;
78 }
79
83 const std::string getLogicType() const {
84 return "policyBasedTrafficLightLogic";
85 }
87
88// virtual bool canRelease(SUMOTime elapsed, bool thresholdPassed, const MSPhaseDefinition* stage, int vehicleCount) throw ()=0;
89
90protected:
91
92 /*
93 * @brief Contains the logic to decide the phase change
94 */
95 bool canRelease();
96
97 /*
98 * This member has to contain the switching logic for SOTL policies
99 */
100 int decideNextPhase();
101
102private:
104};
105
long long int SUMOTime
Definition: GUI.h:36
TrafficLightType
A self-organizing traffic light logic based on a particular policy.
const std::string getLogicType() const
Returns the type of the logic as a string.
MSSOTLPolicyBasedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, const TrafficLightType logicType, const Phases &phases, int step, SUMOTime delay, const Parameterised::Map &parameters, MSSOTLPolicy *policy)
Constructor without sensors passed.
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.
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45