LCOV - code coverage report
Current view: top level - src/activitygen/activities - AGFreeTime.h (source / functions) Coverage Total Hit
Test: lcov.info Lines: 100.0 % 4 4
Test Date: 2024-11-22 15:46:21 Functions: - 0 0

            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              : // activitygen module
       5              : // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
       6              : // This program and the accompanying materials are made available under the
       7              : // terms of the Eclipse Public License 2.0 which is available at
       8              : // https://www.eclipse.org/legal/epl-2.0/
       9              : // This Source Code may also be made available under the following Secondary
      10              : // Licenses when the conditions for such availability set forth in the Eclipse
      11              : // Public License 2.0 are satisfied: GNU General Public License, version 2
      12              : // or later which is available at
      13              : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
      14              : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
      15              : /****************************************************************************/
      16              : /// @file    AGFreeTime.h
      17              : /// @author  Piotr Woznica
      18              : /// @author  Daniel Krajzewicz
      19              : /// @author  Walter Bamberger
      20              : /// @author  Michael Behrisch
      21              : /// @date    July 2010
      22              : ///
      23              : // Generates trips related to after-work activities
      24              : // like visiting the family or party.
      25              : /****************************************************************************/
      26              : #pragma once
      27              : #include <config.h>
      28              : 
      29              : #include <activitygen/city/AGHousehold.h>
      30              : #include "AGActivity.h"
      31              : 
      32              : 
      33              : // ===========================================================================
      34              : // class definitions
      35              : // ===========================================================================
      36         1506 : class AGFreeTime : public AGActivity {
      37              : public:
      38         1506 :     AGFreeTime(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips, int days = 1) :
      39              :         AGActivity(hh, das, prevTrips, 2),
      40         1506 :         freqOut(das->freeTimeActivityRate),
      41         1506 :         nbrDays(days) {};
      42              : 
      43              :     /**
      44              :      * @Overwrite
      45              :      */
      46              :     bool generateTrips();
      47              : 
      48              :     /**
      49              :      * returns the type of trip that will be done on this household
      50              :      * there is also the case: no free time trip
      51              :      * 0 = non
      52              :      * 1 = during the day
      53              :      * 2 = in the evening
      54              :      * 4 = during the night
      55              :      * (combinations using '+' are available for possibleTypeOfTrip())
      56              :      */
      57              :     int possibleTypeOfTrip();
      58              :     int decideTypeOfTrip();
      59              :     /**
      60              :      * The different type of trips that are available:
      61              :      * one function is called among all the following
      62              :      */
      63              :     bool typeFromHomeDay(int day);
      64              :     bool typeFromHomeEvening(int day);
      65              :     bool typeFromHomeNight(int day);
      66              : 
      67              :     /**
      68              :      * returns the moment when everybody is back home and ready
      69              :      * to do some thing else using everyday trips
      70              :      */
      71              :     int whenBackHome();
      72              :     /**
      73              :      * moment when everybody is back home using all trips applicable for the given day
      74              :      * if no car is used: return 0
      75              :      */
      76              :     int whenBackHomeThisDay(int day);
      77              :     /**
      78              :      * moment when the first person takes the car to go somewhere
      79              :      * id no car is used: return 2400 (midnight at the end of the given day)
      80              :      */
      81              :     int whenBeginActivityNextDay(int day);
      82              : 
      83              : private:
      84              :     /**
      85              :      * frequency of going out or see family is assumed to be once a week (in mean)
      86              :      */
      87              :     double freqOut;
      88              :     /**
      89              :      * number of days for the simulation
      90              :      * households are likely to go out some days but not others
      91              :      */
      92              :     int nbrDays;
      93              :     /**
      94              :      * time ready to do something else
      95              :      * everybody is back home
      96              :      */
      97              :     int tReady = 0;
      98              :     /**
      99              :      * possible type of trips for this household
     100              :      */
     101              :     int possibleType = 0;
     102              : 
     103              :     static const int DAY;// = 1;
     104              :     static const int EVENING;// = 2;
     105              :     static const int NIGHT;// = 4;
     106              : 
     107              :     static const int TB_DAY;// = 800;
     108              :     static const int TE_DAY;// = 1800;
     109              :     static const int TB_EVENING;// = 1900;
     110              :     static const int TE_EVENING;// = 2400;
     111              :     static const int TB_NIGHT;// = 2300;
     112              :     static const int TE_NIGHT;// = 500;
     113              : 
     114              : };
        

Generated by: LCOV version 2.0-1