|
SUMO - Simulation of Urban MObility
|
Base class of every person in the city (adults and children) More...
#include <AGPerson.h>
Public Member Functions | |
| virtual bool | decide (SUMOReal probability) const |
| Lets the person make a decision. | |
| virtual int | getAge () const |
| Provides the age of the person. | |
| virtual void | print () const |
| Puts out a summary of the class properties. | |
Protected Member Functions | |
| AGPerson (int age) | |
| Initialises the class attributes. | |
| virtual | ~AGPerson () |
| Cleans up everything. | |
Protected Attributes | |
| int | age |
Base class of every person in the city (adults and children)
This class provides the functionality common to all person in the city. It is a base class for other classes and is not intended to be instantiated as an object. Therefore, all constructors are protected.
Definition at line 49 of file AGPerson.h.
| AGPerson::AGPerson | ( | int | age | ) | [protected] |
Initialises the class attributes.
| [in] | age | the age of the person |
Definition at line 49 of file AGPerson.cpp.
| AGPerson::~AGPerson | ( | ) | [protected, virtual] |
Cleans up everything.
Definition at line 53 of file AGPerson.cpp.
| bool AGPerson::decide | ( | SUMOReal | probability | ) | const [virtual] |
Lets the person make a decision.
The higher the degree of belief is, the more likely this method returns true.
| [in] | degreeOfBelief | how strong the person beliefs the proposition |
Definition at line 72 of file AGPerson.cpp.
References RandHelper::rand().
Referenced by AGAdult::tryToWork().
| int AGPerson::getAge | ( | ) | const [virtual] |
Provides the age of the person.
Definition at line 65 of file AGPerson.cpp.
References age.
| void AGPerson::print | ( | ) | const [virtual] |
Puts out a summary of the class properties.
Reimplemented in AGAdult.
Definition at line 58 of file AGPerson.cpp.
References age.
int AGPerson::age [protected] |
Definition at line 72 of file AGPerson.h.
Referenced by AGChild::alocateASchool(), getAge(), print(), AGChild::print(), and AGAdult::print().