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