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