63 int pop = 0, work = 0;
64 std::vector<AGStreet>::iterator it;
67 pop += (
int)(it->getPopulation());
68 work += (
int)(it->getWorkplaceNumber());
78 neededWorkPositionsInCity *= 1.05f;
89 std::map<std::string, ROEdge*>::const_iterator itE;
90 std::vector<AGStreet>::iterator itS;
94 if (itS->getName() == itE->second->getID()) {
107 std::vector<AGStreet>::iterator it;
108 int workPositionCounter = 0;
113 for (
int i = 0 ; i < it->getWorkplaceNumber() ; ++i) {
115 ++workPositionCounter;
118 }
catch (
const std::bad_alloc& e) {
119 std::cout <<
"Number of work positions at bad_alloc exception: " << workPositionCounter << std::endl;
126 std::cout <<
"--> work position: " << std::endl;
127 std::cout <<
" |-> in city: " << workPositionCounter << std::endl;
136 if (nbrWorkers <= 0) {
149 for (
int i = 0 ; i < nbrOutWorkPositions ; ++i) {
162 std::list<AGBusLine>::iterator it;
171 std::vector<AGStreet>::iterator it;
174 int idHouseholds = 0;
177 people = it->getPopulation();
196 std::list<AGHousehold>::iterator itt;
198 if (itt->getAdultNbr() == 1) {
200 if (itt->adults.front().isWorking()) {
204 if (itt->getAdultNbr() == 2) {
206 if (itt->adults.front().isWorking()) {
209 if (itt->adults.back().isWorking()) {
213 nbrChild += itt->getPeopleNbr() - itt->getAdultNbr();
225 std::cout <<
"--> population: " << std::endl;
226 std::cout <<
" |-> city households: " << nbrHH << std::endl;
227 std::cout <<
" |-> city people: " << nbrSingle + nbrCouple + nbrChild << std::endl;
228 std::cout <<
" |-> city single: " << nbrSingle <<
" / (in) couple: " << nbrCouple << std::endl;
229 std::cout <<
" |-> city adults: " << nbrSingle + nbrCouple << std::endl;
232 std::cout <<
" |-> city children: " << nbrChild << std::endl;
247 std::list<AGHousehold>::iterator it;
250 shortage = !it->allocateChildrenSchool();
273 std::list<AGHousehold>::iterator it;
277 if (it->retiredHouseholders()) {
280 shortage = !it->allocateAdultsWork();
282 std::cout <<
"===> ERROR: Not enough work positions in the city for all working people..." << std::endl;
290 std::list<AGAdult>::iterator itA;
296 std::cout <<
"not enough work for incoming people..." << std::endl;
302 std::list<AGHousehold>::iterator itt;
304 if (itt->getAdultNbr() == 1) {
305 if (itt->adults.front().isWorking()) {
309 if (itt->getAdultNbr() == 2) {
310 if (itt->adults.front().isWorking()) {
313 if (itt->adults.back().isWorking()) {
318 std::cout <<
" |-> working people: " <<
peopleIncoming.size() + workingP << std::endl;
319 std::cout <<
" |-> working people in city: " << workingP << std::endl;
320 std::cout <<
" |-> working people from outside: " <<
peopleIncoming.size() << std::endl;
328 std::list<AGHousehold>::iterator it;
341 if (newRate < 0 || newRate >= 1) {
348 it->generateCars(newRate);
350 nbrAdults += it->getAdultNbr();
374 std::cout <<
"first completed in getStreet() of City: Consolidation of data not needed in ActivityGen any more" << std::endl;
377 std::vector<AGStreet>::iterator it =
streets.begin();
379 if (it->getName() == edge) {
384 std::cout <<
"===> ERROR: WRONG STREET EDGE (" << edge <<
") given and not found in street set." << std::endl;
385 throw(std::runtime_error(
"Street not found with edge id " + edge));
391 throw(std::runtime_error(
"No street found in this city"));