SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // Correspond to given ages and referenced by children. Has a precise location. 00010 /****************************************************************************/ 00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00013 // activitygen module 00014 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) 00015 /****************************************************************************/ 00016 // 00017 // This file is part of SUMO. 00018 // SUMO is free software: you can redistribute it and/or modify 00019 // it under the terms of the GNU General Public License as published by 00020 // the Free Software Foundation, either version 3 of the License, or 00021 // (at your option) any later version. 00022 // 00023 /****************************************************************************/ 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <iostream> 00036 #include <string> 00037 #include "AGSchool.h" 00038 #include "AGPosition.h" 00039 00040 00041 // =========================================================================== 00042 // method definitions 00043 // =========================================================================== 00044 void 00045 AGSchool::print() { 00046 std::cout << "- school: " << " placeNbr=" << capacity << " hours=[" << opening << ";" << closing << "] ages=[" << beginAge << ";" << endAge << "]" << std::endl; 00047 } 00048 00049 int 00050 AGSchool::getPlaces() { 00051 return capacity; 00052 } 00053 00054 bool 00055 AGSchool::addNewChild() { 00056 if (capacity > 0) { 00057 --capacity; 00058 return true; 00059 } 00060 return false; 00061 } 00062 00063 bool 00064 AGSchool::removeChild() { 00065 if (capacity < initCapacity) { 00066 ++capacity; 00067 return true; 00068 } 00069 return false; 00070 } 00071 00072 bool 00073 AGSchool::acceptThisAge(int age) { 00074 if (age <= endAge && age >= beginAge) { 00075 return true; 00076 } 00077 return false; 00078 } 00079 00080 int 00081 AGSchool::getBeginAge() { 00082 return beginAge; 00083 } 00084 00085 int 00086 AGSchool::getEndAge() { 00087 return endAge; 00088 } 00089 00090 AGPosition 00091 AGSchool::getPosition() { 00092 return location; 00093 } 00094 00095 int 00096 AGSchool::getClosingHour() { 00097 return closing; 00098 } 00099 00100 int 00101 AGSchool::getOpeningHour() { 00102 return opening; 00103 } 00104 00105 /****************************************************************************/