SUMO - Simulation of Urban MObility
AGWorkAndSchool.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Generates trips to work and to school
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 // activitygen module
00014 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
00015 /****************************************************************************/
00016 //
00017 //   This file is part of SUMO.
00018 //   SUMO is free software: you can redistribute it and/or modify
00019 //   it under the terms of the GNU General Public License as published by
00020 //   the Free Software Foundation, either version 3 of the License, or
00021 //   (at your option) any later version.
00022 //
00023 /****************************************************************************/
00024 #ifndef AGWORKANDSCHOOL_H
00025 #define AGWORKANDSCHOOL_H
00026 
00027 
00028 // ===========================================================================
00029 // included modules
00030 // ===========================================================================
00031 #ifdef _MSC_VER
00032 #include <windows_config.h>
00033 #else
00034 #include <config.h>
00035 #endif
00036 
00037 #include "../city/AGHousehold.h"
00038 #include "../city/AGPosition.h"
00039 #include "AGActivity.h"
00040 
00041 
00042 // ===========================================================================
00043 // class definitions
00044 // ===========================================================================
00045 class AGWorkAndSchool : public AGActivity {
00046 public:
00047     AGWorkAndSchool(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips) :
00048         AGActivity(hh, das, prevTrips, 1) {};
00049 
00053     bool generateTrips();
00054 
00058     //void buildDestinations();
00059     void buildChildrenAccompaniment();
00060     void buildWorkDestinations();
00061 
00066     void carAllocation();
00067 
00071     bool carsToTrips();
00072 
00076     bool isThereUnusedCar();
00077 
00083     bool checkAndBuildTripConsistancy();
00084 
00089     bool checkDriversScheduleMatching();
00090 
00094     void generateListTrips();
00095 
00100     void makePossibleDriversDrive();
00101 
00107     std::string getUnusedCar();
00108 
00109 private:
00115     //std::list<Position> childrenCarAccompaniment;
00116     std::list<AGChild> childrenNeedingCarAccompaniment;
00120     //std::list<Position> adultCarAccompaniment;
00121     std::list<AGAdult> adultNeedingCarAccompaniment;
00126     //std::list<Position> workDestinations;
00127     std::list<AGAdult> workingPeoplePossCar;
00131     //std::list<Position> carDestinations;
00132     std::list<AGAdult> personsDrivingCars;
00137     std::list<AGAdult> notNeedingDrivers;
00142     std::list<AGTrip> tempAccTrip;
00143     std::list<AGTrip> tempTrip;
00144 };
00145 
00146 #endif
00147 
00148 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines