SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // Person in working age: can be linked to a work position. 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 AGADULT_H 00025 #define AGADULT_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 <vector> 00038 #include <stdexcept> 00039 #include "AGPerson.h" 00040 00041 00042 // =========================================================================== 00043 // class declarations 00044 // =========================================================================== 00045 class AGWorkPosition; 00046 00047 00048 // =========================================================================== 00049 // class definitions 00050 // =========================================================================== 00057 class AGAdult : public AGPerson { 00058 public: 00063 AGAdult(int age) ; 00064 00067 void print() const ; 00068 00073 bool isWorking() const ; 00074 00087 void tryToWork(SUMOReal employmentRate, std::vector<AGWorkPosition>* wps) ; 00088 00095 void lostWorkPosition() ; 00096 00102 void resignFromWorkPosition() ; 00103 00112 const AGWorkPosition& getWorkPosition() const throw(std::runtime_error); 00113 00114 private: 00119 AGWorkPosition* work; 00120 00126 static AGWorkPosition* randomFreeWorkPosition(std::vector<AGWorkPosition>* wps) ; 00127 }; 00128 00129 #endif /* AGADULT_H */ 00130 00131 /****************************************************************************/