63 std::vector<AGStreet>::iterator it;
66 pop += it->getPopulation();
67 work += it->getWorkplaceNumber();
76 neededWorkPositionsInCity *=
SUMOReal(1.05);
87 std::map<std::string, ROEdge*>::const_iterator itE;
88 std::vector<AGStreet>::iterator itS;
92 if (itS->getName() == itE->second->getID()) {
105 std::vector<AGStreet>::iterator it;
106 int workPositionCounter = 0;
111 for (
int i = 0; i < it->getWorkplaceNumber(); ++i) {
113 ++workPositionCounter;
116 }
catch (
const std::bad_alloc& e) {
117 std::cout <<
"Number of work positions at bad_alloc exception: " << workPositionCounter << std::endl;
124 std::cout <<
"--> work position: " << std::endl;
125 std::cout <<
" |-> in city: " << workPositionCounter << std::endl;
134 if (nbrWorkers <= 0) {
147 for (
int i = 0; i < nbrOutWorkPositions; ++i) {
160 std::list<AGBusLine>::iterator it;
169 std::vector<AGStreet>::iterator it;
172 unsigned int idHouseholds = 0;
181 numAdults[i] = -numAdults[i];
182 }
else if (totalChildrenLeft > 0) {
184 totalChildrenLeft -= numChilds[i];
189 for (
int i = 0; i < numSecondPers; i++) {
193 people += it->getPopulation();
194 while (people > 0 && idHouseholds < (
unsigned int)numAdults.size()) {
198 households.back().generatePeople(
abs(numAdults[i]), numChilds[i], numAdults[i] < 0);
201 numAdults[i] = numAdults[numAdults.size() - idHouseholds];
202 numChilds[i] = numChilds[numAdults.size() - idHouseholds];
215 std::list<AGHousehold>::iterator itt;
217 if (itt->getAdultNbr() == 1) {
219 if (itt->getAdults().front().isWorking()) {
223 if (itt->getAdultNbr() == 2) {
225 if (itt->getAdults().front().isWorking()) {
228 if (itt->getAdults().back().isWorking()) {
232 nbrChild += itt->getPeopleNbr() - itt->getAdultNbr();
244 std::cout <<
"--> population: " << std::endl;
245 std::cout <<
" |-> city households: " << nbrHH << std::endl;
246 std::cout <<
" |-> city people: " << nbrSingle + nbrCouple + nbrChild << std::endl;
247 std::cout <<
" |-> city single: " << nbrSingle <<
" / (in) couple: " << nbrCouple << std::endl;
248 std::cout <<
" |-> city adults: " << nbrSingle + nbrCouple << std::endl;
251 std::cout <<
" |-> city children: " << nbrChild << std::endl;
266 std::list<AGHousehold>::iterator it;
269 shortage = !it->allocateChildrenSchool();
292 std::list<AGHousehold>::iterator it;
296 if (it->retiredHouseholders()) {
299 shortage = !it->allocateAdultsWork();
301 std::cout <<
"===> ERROR: Not enough work positions in the city for all working people..." << std::endl;
309 std::list<AGAdult>::iterator itA;
315 std::cout <<
"not enough work for incoming people..." << std::endl;
321 std::list<AGHousehold>::iterator itt;
323 if (itt->getAdultNbr() == 1) {
324 if (itt->getAdults().front().isWorking()) {
328 if (itt->getAdultNbr() == 2) {
329 if (itt->getAdults().front().isWorking()) {
332 if (itt->getAdults().back().isWorking()) {
337 std::cout <<
" |-> working people: " <<
peopleIncoming.size() + workingP << std::endl;
338 std::cout <<
" |-> working people in city: " << workingP << std::endl;
339 std::cout <<
" |-> working people from outside: " <<
peopleIncoming.size() << std::endl;
347 std::list<AGHousehold>::iterator it;
360 if (newRate < 0 || newRate >= 1) {
367 it->generateCars(newRate);
369 nbrAdults += it->getAdultNbr();
393 std::cout <<
"first completed in getStreet() of City: Consolidation of data not needed in ActivityGen any more" << std::endl;
396 std::vector<AGStreet>::iterator it =
streets.begin();
398 if (it->getName() == edge) {
403 std::cout <<
"===> ERROR: WRONG STREET EDGE (" << edge <<
") given and not found in street set." << std::endl;
404 throw(std::runtime_error(
"Street not found with edge id " + edge));
410 throw(std::runtime_error(
"No street found in this city"));