SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGWorkPosition.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Location and schedules of a work position: linked with one adult
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 // activitygen module
14 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
24 #ifndef AGWORKPOSITION_H
25 #define AGWORKPOSITION_H
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
37 #include "AGPosition.h"
38 #include <stdexcept>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class AGStreet;
45 class AGAdult;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
52 // TODO: Change name to AGWorkPlace?
53 // TODO: Counter for free work positions should be in City
54 // TODO: Change name of openingTime to something like startHour or openingHour
56 public:
57  AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet);
58  AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet, SUMOReal pos);
60 
61  void take(AGAdult* ad) throw(std::runtime_error);
62  void let();
63  bool isTaken() const;
64 
65  AGPosition getPosition() const;
66  int getOpening() const;
67  int getClosing() const;
68 
69  void print() const;
70 
71 private:
72  static int generateOpeningTime(const AGDataAndStatistics& ds);
73  static int generateClosingTime(const AGDataAndStatistics& ds);
74 
75 private:
81 };
82 
83 #endif
84 
85 /****************************************************************************/