SUMO - Simulation of Urban MObility
AGWorkPosition.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2010-2017 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 /****************************************************************************/
7 //
8 // This program and the accompanying materials
9 // are made available under the terms of the Eclipse Public License v2.0
10 // which accompanies this distribution, and is available at
11 // http://www.eclipse.org/legal/epl-v20.html
12 //
13 /****************************************************************************/
22 // Location and schedules of a work position: linked with one adult
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, double pos);
60 
61  void take(AGAdult* ad);
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 /****************************************************************************/
AGPosition myLocation
void take(AGAdult *ad)
int getOpening() const
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:62
A model of the street in the city.
Definition: AGStreet.h:59
AGWorkPosition(AGDataAndStatistics *ds, const AGStreet &inStreet)
bool isTaken() const
int getClosing() const
An adult person who can have a job.
Definition: AGAdult.h:57
AGPosition getPosition() const
AGAdult * myAdult
static int generateOpeningTime(const AGDataAndStatistics &ds)
AGDataAndStatistics * myStatData
static int generateClosingTime(const AGDataAndStatistics &ds)
void print() const