SUMO - Simulation of Urban MObility
 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.sourceforge.net/
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
46  std::cout << "- school: " << " placeNbr=" << capacity << " hours=[" << opening << ";" << closing << "] ages=[" << beginAge << ";" << endAge << "]" << std::endl;
47 }
48 
49 int
51  return capacity;
52 }
53 
54 bool
56  if (capacity > 0) {
57  --capacity;
58  return true;
59  }
60  return false;
61 }
62 
63 bool
65  if (capacity < initCapacity) {
66  ++capacity;
67  return true;
68  }
69  return false;
70 }
71 
72 bool
74  if (age <= endAge && age >= beginAge) {
75  return true;
76  }
77  return false;
78 }
79 
80 int
82  return beginAge;
83 }
84 
85 int
87  return endAge;
88 }
89 
92  return location;
93 }
94 
95 int
97  return closing;
98 }
99 
100 int
102  return opening;
103 }
104 
105 /****************************************************************************/