Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 // SPDX-License-Identifier: EPL-2.0
11 /****************************************************************************/
20 // Location and schedules of a work position: linked with one adult
21 /****************************************************************************/
22 #ifndef AGWORKPOSITION_H
23 #define AGWORKPOSITION_H
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #include <config.h>
30 
31 #include "AGPosition.h"
32 #include <stdexcept>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class AGStreet;
39 class AGAdult;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
46 // TODO: Change name to AGWorkPlace?
47 // TODO: Counter for free work positions should be in City
48 // TODO: Change name of openingTime to something like startHour or openingHour
50 public:
51  AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet);
52  AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet, double pos);
54 
55  void take(AGAdult* ad);
56  void let();
57  bool isTaken() const;
58 
59  AGPosition getPosition() const;
60  int getOpening() const;
61  int getClosing() const;
62 
63  void print() const;
64 
65 private:
66  static int generateOpeningTime(const AGDataAndStatistics& ds);
67  static int generateClosingTime(const AGDataAndStatistics& ds);
68 
69 private:
75 };
76 
77 #endif
78 
79 /****************************************************************************/
AGPosition myLocation
void take(AGAdult *ad)
int getOpening() const
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:56
A model of the street in the city.
Definition: AGStreet.h:53
AGWorkPosition(AGDataAndStatistics *ds, const AGStreet &inStreet)
bool isTaken() const
int getClosing() const
An adult person who can have a job.
Definition: AGAdult.h:51
AGPosition getPosition() const
AGAdult * myAdult
static int generateOpeningTime(const AGDataAndStatistics &ds)
AGDataAndStatistics * myStatData
static int generateClosingTime(const AGDataAndStatistics &ds)
void print() const