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.dev/sumo
3 // Copyright (C) 2010-2024 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 are made available under the
7 // terms of the Eclipse Public License 2.0 which is available at
8 // https://www.eclipse.org/legal/epl-2.0/
9 // This Source Code may also be made available under the following Secondary
10 // Licenses when the conditions for such availability set forth in the Eclipse
11 // Public License 2.0 are satisfied: GNU General Public License, version 2
12 // or later which is available at
13 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15 /****************************************************************************/
23 // Location and schedules of a work position: linked with one adult
24 /****************************************************************************/
25 #pragma once
26 #include <config.h>
27 
28 #include "AGPosition.h"
29 #include <stdexcept>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class AGStreet;
36 class AGAdult;
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
43 // TODO: Change name to AGWorkPlace?
44 // TODO: Counter for free work positions should be in City
45 // TODO: Change name of openingTime to something like startHour or openingHour
47 public:
48  AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet);
49  AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet, double pos);
51 
52  void take(AGAdult* ad);
53  void let();
54  bool isTaken() const;
55 
56  AGPosition getPosition() const;
57  int getOpening() const;
58  int getClosing() const;
59 
60  void print() const;
61 
62 private:
63  static int generateOpeningTime(const AGDataAndStatistics& ds);
64  static int generateClosingTime(const AGDataAndStatistics& ds);
65 
66 private:
72 };
An adult person who can have a job.
Definition: AGAdult.h:48
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:53
A model of the street in the city.
Definition: AGStreet.h:50
static int generateOpeningTime(const AGDataAndStatistics &ds)
static int generateClosingTime(const AGDataAndStatistics &ds)
int getClosing() const
int getOpening() const
AGAdult * myAdult
AGPosition getPosition() const
void take(AGAdult *ad)
AGPosition myLocation
void print() const
AGDataAndStatistics * myStatData
bool isTaken() const
AGWorkPosition(AGDataAndStatistics *ds, const AGStreet &inStreet)