SUMO - Simulation of Urban MObility
AGSchool.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 // SPDX-License-Identifier: EPL-2.0
11 /****************************************************************************/
19 // Correspond to given ages and referenced by children. Has a precise location.
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <iostream>
29 #include <string>
30 #include "AGSchool.h"
31 #include "AGPosition.h"
32 
33 
34 // ===========================================================================
35 // method definitions
36 // ===========================================================================
37 void
38 AGSchool::print() const {
39  std::cout << "- school: " << " placeNbr=" << capacity << " hours=[" << opening << ";" << closing << "] ages=[" << beginAge << ";" << endAge << "]" << std::endl;
40 }
41 
42 int
44  return capacity;
45 }
46 
47 bool
49  if (capacity > 0) {
50  --capacity;
51  return true;
52  }
53  return false;
54 }
55 
56 bool
58  if (capacity < initCapacity) {
59  ++capacity;
60  return true;
61  }
62  return false;
63 }
64 
65 bool
67  if (age <= endAge && age >= beginAge) {
68  return true;
69  }
70  return false;
71 }
72 
73 int
75  return beginAge;
76 }
77 
78 int
80  return endAge;
81 }
82 
85  return location;
86 }
87 
88 int
90  return closing;
91 }
92 
93 int
95  return opening;
96 }
97 
98 /****************************************************************************/
int capacity
Definition: AGSchool.h:60
void print() const
Definition: AGSchool.cpp:38
int endAge
Definition: AGSchool.h:59
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:56
bool addNewChild()
Definition: AGSchool.cpp:48
int closing
Definition: AGSchool.h:63
AGPosition getPosition()
Definition: AGSchool.cpp:84
int opening
Definition: AGSchool.h:63
bool acceptThisAge(int age)
Definition: AGSchool.cpp:66
AGPosition location
Definition: AGSchool.h:62
int getEndAge()
Definition: AGSchool.cpp:79
bool removeChild()
Definition: AGSchool.cpp:57
int getOpeningHour()
Definition: AGSchool.cpp:94
int getBeginAge()
Definition: AGSchool.cpp:74
int getClosingHour()
Definition: AGSchool.cpp:89
int getPlaces()
Definition: AGSchool.cpp:43
int initCapacity
Definition: AGSchool.h:61
int beginAge
Definition: AGSchool.h:59