Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGChild Class Reference

#include <AGChild.h>

Inheritance diagram for AGChild:
[legend]
Collaboration diagram for AGChild:
[legend]

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.
virtual int getAge () const
 Provides the age of the person.
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.
bool setSchool (AGSchool *school)

Protected Attributes

int age

Private Attributes

AGSchoolmySchool

Detailed Description

Definition at line 38 of file AGChild.h.

Constructor & Destructor Documentation

◆ AGChild()

AGChild::AGChild ( int age)
inline

Definition at line 40 of file AGChild.h.

References AGPerson::age, AGPerson::AGPerson(), and mySchool.

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 56 of file AGChild.cpp.

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

◆ 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 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
virtualinherited

Provides the age of the person.

Returns
the age in years

Definition at line 48 of file AGPerson.cpp.

References age.

◆ getSchoolClosing()

int AGChild::getSchoolClosing ( ) const

Definition at line 94 of file AGChild.cpp.

References mySchool.

◆ getSchoolLocation()

AGPosition AGChild::getSchoolLocation ( ) const

Definition at line 89 of file AGChild.cpp.

References mySchool.

◆ getSchoolOpening()

int AGChild::getSchoolOpening ( ) const

Definition at line 99 of file AGChild.cpp.

References mySchool.

◆ haveASchool()

bool AGChild::haveASchool ( ) const

Definition at line 84 of file AGChild.cpp.

References mySchool.

◆ leaveSchool()

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

Definition at line 74 of file AGChild.cpp.

References mySchool.

◆ print()

void AGChild::print ( ) const
virtual

Puts out a summary of the class properties.

Reimplemented from AGPerson.

Definition at line 39 of file AGChild.cpp.

References AGPerson::age, and mySchool.

◆ setSchool()

bool AGChild::setSchool ( AGSchool * school)

Definition at line 44 of file AGChild.cpp.

References AGSchool::addNewChild(), and mySchool.

Referenced by allocateASchool().

Here is the caller graph for this function:

Field Documentation

◆ age

int AGPerson::age
protectedinherited

◆ mySchool

AGSchool* AGChild::mySchool
private

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