SUMO - Simulation of Urban MObility

AGWorkPosition.h

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