Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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.
 
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
 

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 AGAdult, and AGChild.

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: