Eclipse 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-2019 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
43
AGSchool::getPlaces
() {
44
return
capacity
;
45
}
46
47
bool
48
AGSchool::addNewChild
() {
49
if
(
capacity
> 0) {
50
--
capacity
;
51
return
true
;
52
}
53
return
false
;
54
}
55
56
bool
57
AGSchool::removeChild
() {
58
if
(
capacity
<
initCapacity
) {
59
++
capacity
;
60
return
true
;
61
}
62
return
false
;
63
}
64
65
bool
66
AGSchool::acceptThisAge
(
int
age) {
67
if
(age <= endAge && age >=
beginAge
) {
68
return
true
;
69
}
70
return
false
;
71
}
72
73
int
74
AGSchool::getBeginAge
() {
75
return
beginAge
;
76
}
77
78
int
79
AGSchool::getEndAge
() {
80
return
endAge
;
81
}
82
83
AGPosition
84
AGSchool::getPosition
() {
85
return
location
;
86
}
87
88
int
89
AGSchool::getClosingHour
() {
90
return
closing
;
91
}
92
93
int
94
AGSchool::getOpeningHour
() {
95
return
opening
;
96
}
97
98
/****************************************************************************/
AGSchool::capacity
int capacity
Definition:
AGSchool.h:60
AGSchool::print
void print() const
Definition:
AGSchool.cpp:38
AGSchool::endAge
int endAge
Definition:
AGSchool.h:59
AGSchool.h
AGPosition
A location in the 2D plane freely positioned on a street.
Definition:
AGPosition.h:56
AGSchool::addNewChild
bool addNewChild()
Definition:
AGSchool.cpp:48
AGSchool::closing
int closing
Definition:
AGSchool.h:63
config.h
AGSchool::getPosition
AGPosition getPosition()
Definition:
AGSchool.cpp:84
AGSchool::opening
int opening
Definition:
AGSchool.h:63
AGPosition.h
AGSchool::acceptThisAge
bool acceptThisAge(int age)
Definition:
AGSchool.cpp:66
AGSchool::location
AGPosition location
Definition:
AGSchool.h:62
AGSchool::getEndAge
int getEndAge()
Definition:
AGSchool.cpp:79
AGSchool::removeChild
bool removeChild()
Definition:
AGSchool.cpp:57
AGSchool::getOpeningHour
int getOpeningHour()
Definition:
AGSchool.cpp:94
AGSchool::getBeginAge
int getBeginAge()
Definition:
AGSchool.cpp:74
AGSchool::getClosingHour
int getClosingHour()
Definition:
AGSchool.cpp:89
AGSchool::getPlaces
int getPlaces()
Definition:
AGSchool.cpp:43
AGSchool::initCapacity
int initCapacity
Definition:
AGSchool.h:61
AGSchool::beginAge
int beginAge
Definition:
AGSchool.h:59
src
activitygen
city
AGSchool.cpp
Generated on Wed Oct 2 2019 20:56:52 for Eclipse SUMO - Simulation of Urban MObility by
1.8.13