LCOV - code coverage report
Current view: top level - src/microsim/traffic_lights - MSSOTLHiLevelTrafficLightLogic.cpp (source / functions) Hit Total Coverage
Test: lcov.info Lines: 17 21 81.0 %
Date: 2024-05-19 15:37:39 Functions: 5 7 71.4 %

          Line data    Source code
       1             : /****************************************************************************/
       2             : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3             : // Copyright (C) 2013-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    MSSOTLHiLevelTrafficLightLogic.cpp
      15             : /// @author  Alessio Bonfietti
      16             : /// @date    Jun 2013
      17             : ///
      18             : /****************************************************************************/
      19             : #include "MSSOTLHiLevelTrafficLightLogic.h"
      20             : 
      21          32 : MSSOTLHiLevelTrafficLightLogic::MSSOTLHiLevelTrafficLightLogic(MSTLLogicControl& tlcontrol,
      22             :         const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases,
      23             :         int step, SUMOTime delay,
      24          32 :         const Parameterised::Map& parameters) :
      25             :     MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
      26          32 :                             parameters) {
      27             :     // Setting default values
      28             : 
      29          32 : }
      30             : 
      31           0 : MSSOTLHiLevelTrafficLightLogic::MSSOTLHiLevelTrafficLightLogic(MSTLLogicControl& tlcontrol,
      32             :         const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases,
      33             :         int step, SUMOTime delay,
      34             :         const Parameterised::Map& parameters,
      35           0 :         MSSOTLSensors* sensors) :
      36             :     MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
      37           0 :                             parameters, sensors) {
      38             :     // Setting default values
      39             : 
      40           0 : }
      41             : 
      42          32 : MSSOTLHiLevelTrafficLightLogic::~MSSOTLHiLevelTrafficLightLogic() {
      43         160 :     for (MSSOTLPolicy* const policy : myPolicies) {
      44         128 :         delete policy;
      45             :     }
      46          32 : }
      47             : 
      48         128 : void MSSOTLHiLevelTrafficLightLogic::addPolicy(MSSOTLPolicy* policy) {
      49         128 :     myPolicies.push_back(policy);
      50         128 : }
      51             : 
      52          32 : void MSSOTLHiLevelTrafficLightLogic::init(NLDetectorBuilder& nb) {
      53          32 :     MSSOTLTrafficLightLogic::init(nb);
      54          32 : }
      55             : 
      56          40 : void MSSOTLHiLevelTrafficLightLogic::activate(MSSOTLPolicy* policy) {
      57          40 :     myCurrentPolicy = policy;
      58          40 : }

Generated by: LCOV version 1.14