|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Person in working age: can be linked to a work position. 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 // activitygen module 00012 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) 00013 /****************************************************************************/ 00014 // 00015 // This program is free software; you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation; either version 2 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef AGADULT_H 00022 #define AGADULT_H 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include <vector> 00035 #include <stdexcept> 00036 #include "AGPerson.h" 00037 00038 00039 // =========================================================================== 00040 // class declarations 00041 // =========================================================================== 00042 class AGWorkPosition; 00043 00044 00045 // =========================================================================== 00046 // class definitions 00047 // =========================================================================== 00054 class AGAdult : public AGPerson { 00055 public: 00060 AGAdult(int age) throw(); 00061 00064 void print() const throw(); 00065 00070 bool isWorking() const throw(); 00071 00084 void tryToWork(SUMOReal employmentRate, std::vector<AGWorkPosition>* wps) throw(); 00085 00092 void lostWorkPosition() throw(); 00093 00099 void resignFromWorkPosition() throw(); 00100 00109 const AGWorkPosition& getWorkPosition() const throw(std::runtime_error); 00110 00111 private: 00116 AGWorkPosition* work; 00117 00123 static AGWorkPosition* randomFreeWorkPosition(std::vector<AGWorkPosition>* wps) throw(); 00124 }; 00125 00126 #endif /* AGADULT_H */ 00127 00128 /****************************************************************************/