SUMO - Simulation of Urban MObility
AGActivity.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Parent object for all activities. Derived classes generate trips for each
00010 // household.
00011 /****************************************************************************/
00012 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00013 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00014 // activitygen module
00015 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
00016 /****************************************************************************/
00017 //
00018 //   This file is part of SUMO.
00019 //   SUMO is free software: you can redistribute it and/or modify
00020 //   it under the terms of the GNU General Public License as published by
00021 //   the Free Software Foundation, either version 3 of the License, or
00022 //   (at your option) any later version.
00023 //
00024 /****************************************************************************/
00025 #ifndef AGACTIVITY_H
00026 #define AGACTIVITY_H
00027 
00028 
00029 // ===========================================================================
00030 // included modules
00031 // ===========================================================================
00032 #ifdef _MSC_VER
00033 #include <windows_config.h>
00034 #else
00035 #include <config.h>
00036 #endif
00037 
00038 #include "AGTrip.h"
00039 #include "../city/AGHousehold.h"
00040 #include "../city/AGDataAndStatistics.h"
00041 
00042 
00043 // ===========================================================================
00044 // class definitions
00045 // ===========================================================================
00046 class AGActivity {
00047 public:
00048     AGActivity(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips, int prio) :
00049         hh(hh),
00050         ds(das),
00051         activityPriority(prio),
00052         genDone(false),
00053         timePerKm(das->speedTimePerKm),
00054         previousTrips(prevTrips),
00055         carPreference(das->carPreference) {};
00056 
00060     bool isGenerated();
00061 
00067     bool generateTrips();
00068 
00077     int possibleTranspMean(AGPosition destination);
00078 
00088     int availableTranspMeans(AGPosition from, AGPosition to);
00089 
00093     int timeToDrive(AGPosition from, AGPosition to);
00094 
00099     int depHour(AGPosition from, AGPosition to, int arrival);
00100     int arrHour(AGPosition from, AGPosition to, int departure);
00101 
00105     int randomTimeBetween(int begin, int end);
00106 
00107 
00108     std::list<AGTrip> partialActivityTrips;
00109     std::list<AGTrip> *previousTrips;
00110     bool genDone;
00111     int activityPriority;
00112     SUMOReal timePerKm;
00116     SUMOReal carPreference;
00117 
00118     AGHousehold* hh;
00119 
00120     AGDataAndStatistics* ds;
00121 
00122 };
00123 
00124 #endif
00125 
00126 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines