SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // Location and schedules of a work position: linked with one adult 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 AGWORKPOSITION_H 00025 #define AGWORKPOSITION_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 "AGPosition.h" 00038 #include <stdexcept> 00039 00040 00041 // =========================================================================== 00042 // class declarations 00043 // =========================================================================== 00044 class AGStreet; 00045 class AGAdult; 00046 class AGDataAndStatistics; 00047 00048 00049 // =========================================================================== 00050 // class definitions 00051 // =========================================================================== 00052 // TODO: Change name to AGWorkPlace? 00053 // TODO: Counter for free work positions should be in City 00054 // TODO: Change name of openingTime to something like startHour or openingHour 00055 class AGWorkPosition { 00056 public: 00057 // TODO: Change order: ds, inStreet [, pos] 00058 AGWorkPosition(const AGStreet& inStreet, AGDataAndStatistics* ds) ; 00059 AGWorkPosition(const AGStreet& inStreet, SUMOReal pos, AGDataAndStatistics* ds) ; 00060 ~AGWorkPosition() ; 00061 00062 void take(AGAdult* ad) throw(std::runtime_error); 00063 void let() ; 00064 bool isTaken() const ; 00065 00066 AGPosition getPosition() const ; 00067 int getOpening() const ; 00068 int getClosing() const ; 00069 00070 void print() const ; 00071 00072 private: 00073 AGDataAndStatistics* ds; 00074 AGAdult* adult; 00075 AGPosition location; 00076 int openingTime; 00077 int closingTime; 00078 00079 static int generateOpeningTime(const AGDataAndStatistics& ds) ; 00080 static int generateClosingTime(const AGDataAndStatistics& ds) ; 00081 }; 00082 00083 #endif 00084 00085 /****************************************************************************/