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-2014 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
/****************************************************************************/
AGSchool::capacity
int capacity
Definition:
AGSchool.h:67
AGSchool::endAge
int endAge
Definition:
AGSchool.h:66
AGSchool.h
windows_config.h
AGPosition
A location in the 2D plane freely positioned on a street.
Definition:
AGPosition.h:63
AGSchool::addNewChild
bool addNewChild()
Definition:
AGSchool.cpp:55
AGSchool::closing
int closing
Definition:
AGSchool.h:70
config.h
AGSchool::getPosition
AGPosition getPosition()
Definition:
AGSchool.cpp:91
AGSchool::opening
int opening
Definition:
AGSchool.h:70
AGPosition.h
AGSchool::acceptThisAge
bool acceptThisAge(int age)
Definition:
AGSchool.cpp:73
AGSchool::location
AGPosition location
Definition:
AGSchool.h:69
AGSchool::getEndAge
int getEndAge()
Definition:
AGSchool.cpp:86
AGSchool::removeChild
bool removeChild()
Definition:
AGSchool.cpp:64
AGSchool::getOpeningHour
int getOpeningHour()
Definition:
AGSchool.cpp:101
AGSchool::print
void print()
Definition:
AGSchool.cpp:45
AGSchool::getBeginAge
int getBeginAge()
Definition:
AGSchool.cpp:81
AGSchool::getClosingHour
int getClosingHour()
Definition:
AGSchool.cpp:96
AGSchool::getPlaces
int getPlaces()
Definition:
AGSchool.cpp:50
AGSchool::initCapacity
int initCapacity
Definition:
AGSchool.h:68
AGSchool::beginAge
int beginAge
Definition:
AGSchool.h:66
tmp
buildd
sumo-0.20.0+dfsg
src
activitygen
city
AGSchool.cpp
Generated on Sat Mar 15 2014 16:04:13 for SUMO - Simulation of Urban MObility by
1.8.6