/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// activitygen module4// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)5// This program and the accompanying materials are made available under the6// terms of the Eclipse Public License 2.0 which is available at7// https://www.eclipse.org/legal/epl-2.0/8// This Source Code may also be made available under the following Secondary9// Licenses when the conditions for such availability set forth in the Eclipse10// Public License 2.0 are satisfied: GNU General Public License, version 211// or later which is available at12// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html13// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later14/****************************************************************************/15/// @file AGSchool.cpp16/// @author Piotr Woznica17/// @author Daniel Krajzewicz18/// @author Walter Bamberger19/// @date July 201020///21// Correspond to given ages and referenced by children. Has a precise location.22/****************************************************************************/23#include <config.h>2425#include <iostream>26#include <string>27#include "AGSchool.h"28#include "AGPosition.h"293031// ===========================================================================32// method definitions33// ===========================================================================34void35AGSchool::print() const {36std::cout << "- school: " << " placeNbr=" << capacity << " hours=[" << opening << ";" << closing << "] ages=[" << beginAge << ";" << endAge << "]" << std::endl;37}3839int40AGSchool::getPlaces() {41return capacity;42}4344bool45AGSchool::addNewChild() {46if (capacity > 0) {47--capacity;48return true;49}50return false;51}5253bool54AGSchool::removeChild() {55if (capacity < initCapacity) {56++capacity;57return true;58}59return false;60}6162bool63AGSchool::acceptThisAge(int age) {64if (age <= endAge && age >= beginAge) {65return true;66}67return false;68}6970int71AGSchool::getBeginAge() {72return beginAge;73}7475int76AGSchool::getEndAge() {77return endAge;78}7980AGPosition81AGSchool::getPosition() {82return location;83}8485int86AGSchool::getClosingHour() {87return closing;88}8990int91AGSchool::getOpeningHour() {92return opening;93}949596/****************************************************************************/979899