SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGChild Class Reference

#include <AGChild.h>

Inheritance diagram for AGChild:
AGPerson

Public Member Functions

 AGChild (int age)
bool alocateASchool (std::list< AGSchool > *schools, AGPosition housePos)
virtual bool decide (SUMOReal probability) const
 Lets the person make a decision.
virtual int getAge () const
 Provides the age of the person.
int getSchoolClosing ()
AGPosition getSchoolLocation ()
int getSchoolOpeining ()
bool haveASchool ()
bool leaveSchool ()
void print ()
virtual void print () const
 Puts out a summary of the class properties.
bool setSchool (AGSchool *school)

Protected Attributes

int age

Private Attributes

AGSchoolschool

Detailed Description

Definition at line 47 of file AGChild.h.

Constructor & Destructor Documentation

AGChild::AGChild ( int  age)
inline

Definition at line 49 of file AGChild.h.

Member Function Documentation

bool AGChild::alocateASchool ( std::list< AGSchool > *  schools,
AGPosition  housePos 
)
Parameters
schools,:school vector from City object
housepos,:Position of the households habitation
Returns
if a school was found corresponding to the child's age.

Definition at line 64 of file AGChild.cpp.

References AGPerson::age, AGPosition::distanceTo(), setSchool(), and SUMOReal.

bool AGPerson::decide ( SUMOReal  probability) const
virtualinherited

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 72 of file AGPerson.cpp.

References RandHelper::rand().

Referenced by AGAdult::tryToWork().

int AGPerson::getAge ( ) const
virtualinherited

Provides the age of the person.

Returns
the age in years

Definition at line 65 of file AGPerson.cpp.

References AGPerson::age.

int AGChild::getSchoolClosing ( )

Definition at line 105 of file AGChild.cpp.

References AGSchool::getClosingHour(), and school.

AGPosition AGChild::getSchoolLocation ( )

Definition at line 100 of file AGChild.cpp.

References AGSchool::getPosition(), and school.

int AGChild::getSchoolOpeining ( )

Definition at line 110 of file AGChild.cpp.

References AGSchool::getOpeningHour(), and school.

bool AGChild::haveASchool ( )

Definition at line 92 of file AGChild.cpp.

References school.

bool AGChild::leaveSchool ( )
Returns
if the child is now without any school

Definition at line 82 of file AGChild.cpp.

References AGSchool::removeChild(), and school.

void AGChild::print ( )

Definition at line 47 of file AGChild.cpp.

References AGPerson::age, and school.

void AGPerson::print ( ) const
virtualinherited

Puts out a summary of the class properties.

Reimplemented in AGAdult.

Definition at line 58 of file AGPerson.cpp.

References AGPerson::age.

bool AGChild::setSchool ( AGSchool school)

Definition at line 52 of file AGChild.cpp.

References AGSchool::addNewChild(), and school.

Referenced by alocateASchool().

Field Documentation

int AGPerson::age
protectedinherited

Definition at line 72 of file AGPerson.h.

Referenced by alocateASchool(), AGPerson::getAge(), print(), AGAdult::print(), and AGPerson::print().

AGSchool* AGChild::school
private

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