Line data Source code
1 : /****************************************************************************/ 2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo 3 : // Copyright (C) 2010-2024 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 : /****************************************************************************/ 14 : /// @file MSSOTLRequestPolicy.cpp 15 : /// @author Gianfilippo Slager 16 : /// @author Anna Chiara Bellini 17 : /// @date Apr 2013 18 : /// 19 : // The class for SOTL Request logics 20 : /****************************************************************************/ 21 : 22 : #include "MSSOTLRequestPolicy.h" 23 : 24 32 : MSSOTLRequestPolicy::MSSOTLRequestPolicy( 25 32 : const Parameterised::Map& parameters) : 26 32 : MSSOTLPolicy("Request", parameters) { 27 32 : } 28 : 29 0 : MSSOTLRequestPolicy::MSSOTLRequestPolicy( 30 0 : MSSOTLPolicyDesirability* desirabilityAlgorithm) : 31 0 : MSSOTLPolicy("Request", desirabilityAlgorithm) { 32 0 : getDesirabilityAlgorithm()->setKeyPrefix("REQUEST"); 33 0 : } 34 : 35 0 : MSSOTLRequestPolicy::MSSOTLRequestPolicy( 36 : MSSOTLPolicyDesirability* desirabilityAlgorithm, 37 0 : const Parameterised::Map& parameters) : 38 0 : MSSOTLPolicy("Request", desirabilityAlgorithm, parameters) { 39 0 : getDesirabilityAlgorithm()->setKeyPrefix("REQUEST"); 40 : 41 0 : } 42 : 43 33000 : bool MSSOTLRequestPolicy::canRelease(SUMOTime elapsed, bool thresholdPassed, bool /* pushButtonPressed */, 44 : const MSPhaseDefinition* /* stage */, int /* vehicleCount */) { 45 33000 : if (elapsed >= getMinDecisionalPhaseDuration()) { 46 19112 : return thresholdPassed; 47 : } 48 : return false; 49 : }