Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGSchool.cpp
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2024 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 are made available under the
7
// terms of the Eclipse Public License 2.0 which is available at
8
// https://www.eclipse.org/legal/epl-2.0/
9
// This Source Code may also be made available under the following Secondary
10
// Licenses when the conditions for such availability set forth in the Eclipse
11
// Public License 2.0 are satisfied: GNU General Public License, version 2
12
// or later which is available at
13
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15
/****************************************************************************/
22
// Correspond to given ages and referenced by children. Has a precise location.
23
/****************************************************************************/
24
#include <config.h>
25
26
#include <iostream>
27
#include <string>
28
#include "
AGSchool.h
"
29
#include "
AGPosition.h
"
30
31
32
// ===========================================================================
33
// method definitions
34
// ===========================================================================
35
void
36
AGSchool::print
()
const
{
37
std::cout <<
"- school: "
<<
" placeNbr="
<<
capacity
<<
" hours=["
<<
opening
<<
";"
<<
closing
<<
"] ages=["
<<
beginAge
<<
";"
<<
endAge
<<
"]"
<< std::endl;
38
}
39
40
int
41
AGSchool::getPlaces
() {
42
return
capacity
;
43
}
44
45
bool
46
AGSchool::addNewChild
() {
47
if
(
capacity
> 0) {
48
--
capacity
;
49
return
true
;
50
}
51
return
false
;
52
}
53
54
bool
55
AGSchool::removeChild
() {
56
if
(
capacity
<
initCapacity
) {
57
++
capacity
;
58
return
true
;
59
}
60
return
false
;
61
}
62
63
bool
64
AGSchool::acceptThisAge
(
int
age) {
65
if
(age <= endAge && age >=
beginAge
) {
66
return
true
;
67
}
68
return
false
;
69
}
70
71
int
72
AGSchool::getBeginAge
() {
73
return
beginAge
;
74
}
75
76
int
77
AGSchool::getEndAge
() {
78
return
endAge
;
79
}
80
81
AGPosition
82
AGSchool::getPosition
() {
83
return
location
;
84
}
85
86
int
87
AGSchool::getClosingHour
() {
88
return
closing
;
89
}
90
91
int
92
AGSchool::getOpeningHour
() {
93
return
opening
;
94
}
95
96
97
/****************************************************************************/
AGPosition.h
AGSchool.h
AGPosition
A location in the 2D plane freely positioned on a street.
Definition
AGPosition.h:53
AGSchool::getBeginAge
int getBeginAge()
Definition
AGSchool.cpp:72
AGSchool::opening
int opening
Definition
AGSchool.h:60
AGSchool::initCapacity
int initCapacity
Definition
AGSchool.h:58
AGSchool::getClosingHour
int getClosingHour()
Definition
AGSchool.cpp:87
AGSchool::removeChild
bool removeChild()
Definition
AGSchool.cpp:55
AGSchool::print
void print() const
Definition
AGSchool.cpp:36
AGSchool::endAge
int endAge
Definition
AGSchool.h:56
AGSchool::getPosition
AGPosition getPosition()
Definition
AGSchool.cpp:82
AGSchool::getOpeningHour
int getOpeningHour()
Definition
AGSchool.cpp:92
AGSchool::getEndAge
int getEndAge()
Definition
AGSchool.cpp:77
AGSchool::beginAge
int beginAge
Definition
AGSchool.h:56
AGSchool::capacity
int capacity
Definition
AGSchool.h:57
AGSchool::closing
int closing
Definition
AGSchool.h:60
AGSchool::acceptThisAge
bool acceptThisAge(int age)
Definition
AGSchool.cpp:64
AGSchool::addNewChild
bool addNewChild()
Definition
AGSchool.cpp:46
AGSchool::getPlaces
int getPlaces()
Definition
AGSchool.cpp:41
AGSchool::location
AGPosition location
Definition
AGSchool.h:59
src
activitygen
city
AGSchool.cpp
Generated on Mon Dec 23 2024 00:15:52 for Eclipse SUMO - Simulation of Urban MObility by
1.9.8