40 std::cout <<
"- Child: Age=" <<
age <<
" School=" <<
mySchool << std::endl;
45 if (school ==
nullptr) {
57 double minDist = std::numeric_limits<double>::infinity();
59 if (schools->size() == 0) {
62 std::list<AGSchool>::iterator it;
64 for (it = schools->begin(); it != schools->end(); ++it) {
65 if (it->acceptThisAge(
age) && it->getPlaces() > 0 && housePos.
distanceTo(it->getPosition()) < minDist) {
66 minDist = housePos.
distanceTo(it->getPosition());
bool allocateASchool(std::list< AGSchool > *schools, AGPosition housePos)
bool setSchool(AGSchool *school)
int getSchoolOpening() const
AGPosition getSchoolLocation() const
void print() const
Puts out a summary of the class properties.
int getSchoolClosing() const
A location in the 2D plane freely positioned on a street.
double distanceTo(const AGPosition &otherPos) const
Computes the distance between two AGPosition objects.