39 std::vector<AGWorkPosition*> freePos;
40 for (std::vector<AGWorkPosition>::iterator i = wps->begin(); i != wps->end(); ++i) {
42 freePos.push_back(&*i);
45 if (freePos.empty()) {
58 std::cout <<
"- AGAdult: Age=" <<
age <<
" Work=" <<
work << std::endl;
69 if (
work !=
nullptr) {
73 if (
work !=
nullptr) {
77 if (
work !=
nullptr) {
87 return (
work !=
nullptr);
99 if (
work !=
nullptr) {
107 if (
work !=
nullptr) {
110 throw ProcessError(
"AGAdult::getWorkPosition: Adult is unemployed.");
void print() const
Puts out a summary of the attributes.
void tryToWork(double employmentRate, std::vector< AGWorkPosition > *wps)
Tries to get a new work position.
bool isWorking() const
States whether this person occupies a work position at present.
AGAdult(int age)
Initialises the base class and the own attributes.
static AGWorkPosition * randomFreeWorkPosition(std::vector< AGWorkPosition > *wps)
Randomly selects a free work position from the list.
const AGWorkPosition & getWorkPosition() const
Provides the work position of the adult.
void lostWorkPosition()
Called when the adult has lost her job.
void resignFromWorkPosition()
Called when the adult should resign her job.
Base class of every person in the city (adults and children)
virtual bool decide(double probability) const
Lets the person make a decision.
static const T & getRandomFrom(const std::vector< T > &v, SumoRNG *rng=nullptr)
Returns a random element from the given vector.