|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Parent object for all activities. Derived classes generate trips for each 00008 // household. 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 AGACTIVITY_H 00023 #define AGACTIVITY_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 "AGTrip.h" 00036 #include "../city/AGHousehold.h" 00037 #include "../city/AGDataAndStatistics.h" 00038 00039 00040 // =========================================================================== 00041 // class definitions 00042 // =========================================================================== 00043 class AGActivity { 00044 public: 00045 AGActivity(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips, int prio) : 00046 hh(hh), 00047 ds(das), 00048 activityPriority(prio), 00049 genDone(false), 00050 timePerKm(das->speedTimePerKm), 00051 previousTrips(prevTrips), 00052 carPreference(das->carPreference) {}; 00053 00057 bool isGenerated(); 00058 00064 bool generateTrips(); 00065 00074 int possibleTranspMean(AGPosition destination); 00075 00085 int availableTranspMeans(AGPosition from, AGPosition to); 00086 00090 int timeToDrive(AGPosition from, AGPosition to); 00091 00096 int depHour(AGPosition from, AGPosition to, int arrival); 00097 int arrHour(AGPosition from, AGPosition to, int departure); 00098 00102 int randomTimeBetween(int begin, int end); 00103 00104 00105 std::list<AGTrip> partialActivityTrips; 00106 std::list<AGTrip> *previousTrips; 00107 bool genDone; 00108 int activityPriority; 00109 SUMOReal timePerKm; 00113 SUMOReal carPreference; 00114 00115 AGHousehold* hh; 00116 00117 AGDataAndStatistics* ds; 00118 00119 }; 00120 00121 #endif 00122 00123 /****************************************************************************/