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