SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGAdult.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Person in working age: can be linked to a work position.
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2010-2014 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 AGADULT_H
26 #define AGADULT_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 <vector>
39 #include <stdexcept>
40 #include "AGPerson.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class AGWorkPosition;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
58 class AGAdult : public AGPerson {
59 public:
64  AGAdult(int age);
65 
68  void print() const;
69 
74  bool isWorking() const;
75 
88  void tryToWork(SUMOReal employmentRate, std::vector<AGWorkPosition>* wps);
89 
96  void lostWorkPosition();
97 
103  void resignFromWorkPosition();
104 
113  const AGWorkPosition& getWorkPosition() const;
114 
115 private:
121 
127  static AGWorkPosition* randomFreeWorkPosition(std::vector<AGWorkPosition>* wps);
128 };
129 
130 #endif /* AGADULT_H */
131 
132 /****************************************************************************/
void tryToWork(SUMOReal employmentRate, std::vector< AGWorkPosition > *wps)
Tries to get a new work position.
Definition: AGAdult.cpp:72
AGWorkPosition * work
Definition: AGAdult.h:120
void print() const
Puts out a summary of the attributes.
Definition: AGAdult.cpp:65
An adult person who can have a job.
Definition: AGAdult.h:58
void resignFromWorkPosition()
Called when the adult should resign her job.
Definition: AGAdult.cpp:108
static AGWorkPosition * randomFreeWorkPosition(std::vector< AGWorkPosition > *wps)
Randomly selects a free work position from the list.
Definition: AGAdult.cpp:46
void lostWorkPosition()
Called when the adult has lost her job.
Definition: AGAdult.cpp:101
AGAdult(int age)
Initialises the base class and the own attributes.
Definition: AGAdult.cpp:59
int age
Definition: AGPerson.h:72
#define SUMOReal
Definition: config.h:215
bool isWorking() const
States whether this person occupies a work position at present.
Definition: AGAdult.cpp:94
const AGWorkPosition & getWorkPosition() const
Provides the work position of the adult.
Definition: AGAdult.cpp:117
Base class of every person in the city (adults and children)
Definition: AGPerson.h:49