SUMO - Simulation of Urban MObility

AGPerson Class Reference

Base class of every person in the city (adults and children) More...

#include <AGPerson.h>

Inheritance diagram for AGPerson:
AGAdult AGChild

Public Member Functions

virtual bool decide (SUMOReal probability) const throw ()
 Lets the person make a decision.
virtual int getAge () const throw ()
 Provides the age of the person.
virtual void print () const throw ()
 Puts out a summary of the class properties.

Protected Member Functions

 AGPerson (int age) throw ()
 Initialises the class attributes.
virtual ~AGPerson () throw ()
 Cleans up everything.

Protected Attributes

int age

Detailed Description

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 46 of file AGPerson.h.


Constructor & Destructor Documentation

AGPerson::AGPerson ( int  age) throw () [protected]

Initialises the class attributes.

Parameters:
[in]agethe age of the person

Definition at line 46 of file AGPerson.cpp.

AGPerson::~AGPerson ( ) throw () [protected, virtual]

Cleans up everything.

Definition at line 50 of file AGPerson.cpp.


Member Function Documentation

bool AGPerson::decide ( SUMOReal  probability) const throw () [virtual]

Lets the person make a decision.

The higher the degree of belief is, the more likely this method returns true.

Parameters:
[in]degreeOfBeliefhow strong the person beliefs the proposition
Returns:
whether the person agrees with the proposition

Definition at line 69 of file AGPerson.cpp.

References RandHelper::rand().

int AGPerson::getAge ( ) const throw () [virtual]

Provides the age of the person.

Returns:
the age in years

Definition at line 62 of file AGPerson.cpp.

void AGPerson::print ( ) const throw () [virtual]

Puts out a summary of the class properties.

Reimplemented in AGAdult.

Definition at line 55 of file AGPerson.cpp.


Field Documentation

int AGPerson::age [protected]

Definition at line 69 of file AGPerson.h.

Referenced by AGChild::alocateASchool(), AGChild::print(), and AGAdult::print().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines