SUMO - Simulation of Urban MObility
AGChild Class Reference

#include <AGChild.h>

Inheritance diagram for AGChild:
Inheritance graph
Collaboration diagram for AGChild:
Collaboration graph

Public Member Functions

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

Protected Attributes

int age
 

Private Attributes

AGSchoolschool
 

Detailed Description

Definition at line 41 of file AGChild.h.

Constructor & Destructor Documentation

◆ AGChild()

AGChild::AGChild ( int  age)
inline

Member Function Documentation

◆ allocateASchool()

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

Definition at line 58 of file AGChild.cpp.

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

Referenced by AGChild().

◆ decide()

bool AGPerson::decide ( double  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 56 of file AGPerson.cpp.

References RandHelper::rand().

Referenced by AGAdult::tryToWork().

◆ getAge()

int AGPerson::getAge ( ) const
virtualinherited

Provides the age of the person.

Returns
the age in years

Definition at line 50 of file AGPerson.cpp.

References AGPerson::age.

◆ getSchoolClosing()

int AGChild::getSchoolClosing ( ) const

Definition at line 96 of file AGChild.cpp.

References AGSchool::getClosingHour(), and school.

Referenced by AGChild().

◆ getSchoolLocation()

AGPosition AGChild::getSchoolLocation ( ) const

Definition at line 91 of file AGChild.cpp.

References AGSchool::getPosition(), and school.

Referenced by AGChild().

◆ getSchoolOpening()

int AGChild::getSchoolOpening ( ) const

Definition at line 101 of file AGChild.cpp.

References AGSchool::getOpeningHour(), and school.

Referenced by AGChild().

◆ haveASchool()

bool AGChild::haveASchool ( ) const

Definition at line 86 of file AGChild.cpp.

References school.

Referenced by AGChild().

◆ leaveSchool()

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

Definition at line 76 of file AGChild.cpp.

References AGSchool::removeChild(), and school.

Referenced by AGChild().

◆ print()

void AGChild::print ( ) const
virtual

Puts out a summary of the class properties.

Reimplemented from AGPerson.

Definition at line 41 of file AGChild.cpp.

References AGPerson::age, and school.

Referenced by AGChild().

◆ setSchool()

bool AGChild::setSchool ( AGSchool school)

Definition at line 46 of file AGChild.cpp.

References AGSchool::addNewChild(), and school.

Referenced by AGChild(), and allocateASchool().

Field Documentation

◆ age

int AGPerson::age
protectedinherited

Definition at line 65 of file AGPerson.h.

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

◆ school

AGSchool* AGChild::school
private

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