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

            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           16 : 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           16 :         const Parameterised::Map& parameters) :
      25              :     MSSOTLTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay,
      26           16 :                             parameters) {
      27              :     // Setting default values
      28              : 
      29           16 : }
      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           16 : MSSOTLHiLevelTrafficLightLogic::~MSSOTLHiLevelTrafficLightLogic() {
      43           80 :     for (MSSOTLPolicy* const policy : myPolicies) {
      44           64 :         delete policy;
      45              :     }
      46           16 : }
      47              : 
      48           64 : void MSSOTLHiLevelTrafficLightLogic::addPolicy(MSSOTLPolicy* policy) {
      49           64 :     myPolicies.push_back(policy);
      50           64 : }
      51              : 
      52           16 : void MSSOTLHiLevelTrafficLightLogic::init(NLDetectorBuilder& nb) {
      53           16 :     MSSOTLTrafficLightLogic::init(nb);
      54           16 : }
      55              : 
      56           20 : void MSSOTLHiLevelTrafficLightLogic::activate(MSSOTLPolicy* policy) {
      57           20 :     myCurrentPolicy = policy;
      58           20 : }
        

Generated by: LCOV version 2.0-1