|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Generates trips related to after-work activities 00008 // like visiting the family or party. 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00012 // activitygen module 00013 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) 00014 /****************************************************************************/ 00015 // 00016 // This program is free software; you can redistribute it and/or modify 00017 // it under the terms of the GNU General Public License as published by 00018 // the Free Software Foundation; either version 2 of the License, or 00019 // (at your option) any later version. 00020 // 00021 /****************************************************************************/ 00022 #ifndef AGFREETIME_H 00023 #define AGFREETIME_H 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include "../city/AGHousehold.h" 00036 #include "AGActivity.h" 00037 00038 00039 // =========================================================================== 00040 // class definitions 00041 // =========================================================================== 00042 class AGFreeTime : public AGActivity { 00043 public: 00044 AGFreeTime(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips) : 00045 AGActivity(hh, das, prevTrips, 2), 00046 freqOut(das->freeTimeActivityRate), 00047 nbrDays(1) {}; 00048 AGFreeTime(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips, int days) : 00049 AGActivity(hh, das, prevTrips, 2), 00050 freqOut(das->freeTimeActivityRate), 00051 nbrDays(days) {}; 00052 00056 bool generateTrips(); 00057 00067 int possibleTypeOfTrip(); 00068 int decideTypeOfTrip(); 00073 bool typeFromHomeDay(int day); 00074 bool typeFromHomeEvening(int day); 00075 bool typeFromHomeNight(int day); 00076 00081 int whenBackHome(); 00086 int whenBackHomeThisDay(int day); 00091 int whenBeginActivityNextDay(int day); 00092 00093 private: 00098 int nbrDays; 00103 int tReady; 00107 int possibleType; 00111 SUMOReal freqOut; 00112 00113 static const int DAY;// = 1; 00114 static const int EVENING;// = 2; 00115 static const int NIGHT;// = 4; 00116 00117 static const int TB_DAY;// = 800; 00118 static const int TE_DAY;// = 1800; 00119 static const int TB_EVENING;// = 1900; 00120 static const int TE_EVENING;// = 2400; 00121 static const int TB_NIGHT;// = 2300; 00122 static const int TE_NIGHT;// = 500; 00123 00124 }; 00125 00126 #endif 00127 00128 /****************************************************************************/