SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
AGSchool.cpp
Go to the documentation of this file.
1
/****************************************************************************/
9
// Correspond to given ages and referenced by children. Has a precise location.
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12
// Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13
// activitygen module
14
// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
15
/****************************************************************************/
16
//
17
// This file is part of SUMO.
18
// SUMO is free software: you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation, either version 3 of the License, or
21
// (at your option) any later version.
22
//
23
/****************************************************************************/
24
25
26
// ===========================================================================
27
// included modules
28
// ===========================================================================
29
#ifdef _MSC_VER
30
#include <
windows_config.h
>
31
#else
32
#include <
config.h
>
33
#endif
34
35
#include <iostream>
36
#include <string>
37
#include "
AGSchool.h
"
38
#include "
AGPosition.h
"
39
40
41
// ===========================================================================
42
// method definitions
43
// ===========================================================================
44
void
45
AGSchool::print
() {
46
std::cout <<
"- school: "
<<
" placeNbr="
<<
capacity
<<
" hours=["
<<
opening
<<
";"
<<
closing
<<
"] ages=["
<<
beginAge
<<
";"
<<
endAge
<<
"]"
<< std::endl;
47
}
48
49
int
50
AGSchool::getPlaces
() {
51
return
capacity
;
52
}
53
54
bool
55
AGSchool::addNewChild
() {
56
if
(
capacity
> 0) {
57
--
capacity
;
58
return
true
;
59
}
60
return
false
;
61
}
62
63
bool
64
AGSchool::removeChild
() {
65
if
(
capacity
<
initCapacity
) {
66
++
capacity
;
67
return
true
;
68
}
69
return
false
;
70
}
71
72
bool
73
AGSchool::acceptThisAge
(
int
age) {
74
if
(age <= endAge && age >=
beginAge
) {
75
return
true
;
76
}
77
return
false
;
78
}
79
80
int
81
AGSchool::getBeginAge
() {
82
return
beginAge
;
83
}
84
85
int
86
AGSchool::getEndAge
() {
87
return
endAge
;
88
}
89
90
AGPosition
91
AGSchool::getPosition
() {
92
return
location
;
93
}
94
95
int
96
AGSchool::getClosingHour
() {
97
return
closing
;
98
}
99
100
int
101
AGSchool::getOpeningHour
() {
102
return
opening
;
103
}
104
105
/****************************************************************************/
build
buildd
sumo-0.18~dfsg
src
activitygen
city
AGSchool.cpp
Generated on Wed Oct 23 2013 01:15:07 for SUMO - Simulation of Urban MObility by
1.8.4