Eclipse 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:
[legend]

Public Member Functions

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

Protected Member Functions

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

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

Constructor & Destructor Documentation

◆ AGPerson()

AGPerson::AGPerson ( int  age)
protected

Initialises the class attributes.

Parameters
[in]agethe age of the person

Definition at line 35 of file AGPerson.cpp.

◆ ~AGPerson()

AGPerson::~AGPerson ( )
protectedvirtual

Cleans up everything.

Definition at line 38 of file AGPerson.cpp.

Member Function Documentation

◆ decide()

bool AGPerson::decide ( double  probability) const
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 54 of file AGPerson.cpp.

References RandHelper::rand().

Referenced by AGAdult::tryToWork().

Here is the caller graph for this function:

◆ getAge()

int AGPerson::getAge ( ) const
virtual

Provides the age of the person.

Returns
the age in years

Definition at line 48 of file AGPerson.cpp.

References age.

◆ print()

void AGPerson::print ( ) const
virtual

Puts out a summary of the class properties.

Reimplemented in AGChild, and AGAdult.

Definition at line 42 of file AGPerson.cpp.

References age.

Field Documentation

◆ age

int AGPerson::age
protected

Definition at line 62 of file AGPerson.h.

Referenced by AGChild::allocateASchool(), getAge(), AGAdult::print(), AGChild::print(), and print().


The documentation for this class was generated from the following files: