SUMO - Simulation of Urban MObility
AGAdult.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 // Person in working age: can be linked to a work position.
23 /****************************************************************************/
24 #ifndef AGADULT_H
25 #define AGADULT_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 <vector>
38 #include <stdexcept>
39 #include "AGPerson.h"
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class AGWorkPosition;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
57 class AGAdult : public AGPerson {
58 public:
63  AGAdult(int age);
64 
67  void print() const;
68 
73  bool isWorking() const;
74 
87  void tryToWork(double employmentRate, std::vector<AGWorkPosition>* wps);
88 
95  void lostWorkPosition();
96 
102  void resignFromWorkPosition();
103 
112  const AGWorkPosition& getWorkPosition() const;
113 
114 private:
120 
126  static AGWorkPosition* randomFreeWorkPosition(std::vector<AGWorkPosition>* wps);
127 };
128 
129 #endif /* AGADULT_H */
130 
131 /****************************************************************************/
const AGWorkPosition & getWorkPosition() const
Provides the work position of the adult.
Definition: AGAdult.cpp:111
bool isWorking() const
States whether this person occupies a work position at present.
Definition: AGAdult.cpp:91
AGWorkPosition * work
Definition: AGAdult.h:119
An adult person who can have a job.
Definition: AGAdult.h:57
void resignFromWorkPosition()
Called when the adult should resign her job.
Definition: AGAdult.cpp:103
static AGWorkPosition * randomFreeWorkPosition(std::vector< AGWorkPosition > *wps)
Randomly selects a free work position from the list.
Definition: AGAdult.cpp:45
void lostWorkPosition()
Called when the adult has lost her job.
Definition: AGAdult.cpp:97
void tryToWork(double employmentRate, std::vector< AGWorkPosition > *wps)
Tries to get a new work position.
Definition: AGAdult.cpp:70
AGAdult(int age)
Initialises the base class and the own attributes.
Definition: AGAdult.cpp:59
void print() const
Puts out a summary of the attributes.
Definition: AGAdult.cpp:64
int age
Definition: AGPerson.h:71
Base class of every person in the city (adults and children)
Definition: AGPerson.h:48