SUMO - Simulation of Urban MObility
MSSOTLRequestPolicy.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2010-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // The class for SOTL Request logics
19 /****************************************************************************/
20 
21 #include "MSSOTLRequestPolicy.h"
22 
24  const std::map<std::string, std::string>& parameters) :
25  MSSOTLPolicy("Request", parameters) {
26 }
27 
29  MSSOTLPolicyDesirability* desirabilityAlgorithm) :
30  MSSOTLPolicy("Request", desirabilityAlgorithm) {
32 }
33 
35  MSSOTLPolicyDesirability* desirabilityAlgorithm,
36  const std::map<std::string, std::string>& parameters) :
37  MSSOTLPolicy("Request", desirabilityAlgorithm, parameters) {
39 
40 }
41 
42 bool MSSOTLRequestPolicy::canRelease(SUMOTime elapsed, bool thresholdPassed, bool /* pushButtonPressed */,
43  const MSPhaseDefinition* /* stage */, int /* vehicleCount */) {
44  if (elapsed >= getMinDecisionalPhaseDuration()) {
45  return thresholdPassed;
46  }
47  return false;
48 }
MSSOTLPolicyDesirability * getDesirabilityAlgorithm()
Definition: MSSOTLPolicy.h:127
bool canRelease(SUMOTime elapsed, bool thresholdPassed, bool pushButtonPressed, const MSPhaseDefinition *stage, int vehicleCount)
void setKeyPrefix(std::string val)
This class determines the desirability algorithm of a MSSOTLPolicy when used in combination with a hi...
Class for a low-level policy.
Definition: MSSOTLPolicy.h:71
long long int SUMOTime
Definition: TraCIDefs.h:51
The definition of a single phase of a tls logic.
MSSOTLRequestPolicy(const std::map< std::string, std::string > &parameters)