![]() |
SUMO - Simulation of Urban MObility
|
#include <AGCity.h>
Public Member Functions | |
AGCity (RONet *net) | |
void | carAllocation () |
void | completeBusLines () |
void | completeStreets () |
void | generatePopulation () |
void | generateWorkPositions () |
const AGStreet & | getRandomStreet () |
const AGStreet & | getStreet (const std::string &edge) |
void | schoolAllocation () |
void | workAllocation () |
Data Fields | |
std::list< AGBusLine > | busLines |
std::vector< AGPosition > | cityGates |
std::list< AGHousehold > | households |
std::list< AGAdult > | peopleIncoming |
std::list< AGSchool > | schools |
AGDataAndStatistics & | statData |
std::vector< AGStreet * > | streets |
std::vector< AGWorkPosition > | workPositions |
Private Member Functions | |
AGSchool | closestSchoolTo (AGPosition pos) |
void | generateIncomingPopulation () |
void | generateOutgoingWP () |
AGCity & | operator= (const AGCity &) |
invalidated assignment operator More... | |
Private Attributes | |
int | nbrCars |
RONet * | net |
bool | streetsCompleted |
|
inline |
Definition at line 61 of file AGCity.h.
References carAllocation(), completeBusLines(), completeStreets(), generatePopulation(), generateWorkPositions(), getRandomStreet(), getStreet(), schoolAllocation(), and workAllocation().
void AGCity::carAllocation | ( | ) |
Definition at line 356 of file AGCity.cpp.
References AGDataAndStatistics::busStations, AGDataAndStatistics::carRate, AGDataAndStatistics::getPeopleOlderThan(), AGDataAndStatistics::hhFarFromPT, households, AGDataAndStatistics::householdsNbr, AGDataAndStatistics::limitAgeChildren, nbrCars, and statData.
Referenced by AGCity(), and AGActivityGen::importInfoCity().
|
private |
void AGCity::completeBusLines | ( | ) |
Definition at line 158 of file AGCity.cpp.
References busLines.
Referenced by AGCity(), and AGActivityGen::importInfoCity().
void AGCity::completeStreets | ( | ) |
generates streets: complete the "streets" vector using the DataAndStat's map edges.
Definition at line 56 of file AGCity.cpp.
References AGDataAndStatistics::factorInhabitants, AGDataAndStatistics::factorWorkPositions, RONet::getEdgeMap(), AGDataAndStatistics::getPeopleYoungerThan(), AGDataAndStatistics::incomingTraffic, AGDataAndStatistics::inhabitants, AGDataAndStatistics::laborDemand, AGDataAndStatistics::limitAgeChildren, AGDataAndStatistics::limitAgeRetirement, net, statData, streets, streetsCompleted, AGDataAndStatistics::unemployement, and AGDataAndStatistics::workPositions.
Referenced by AGCity(), getStreet(), and AGActivityGen::importInfoCity().
|
private |
generates people from outside the city for incoming traffic generation
Definition at line 261 of file AGCity.cpp.
References AGDataAndStatistics::getRandomPopDistributed(), AGDataAndStatistics::incomingTraffic, AGDataAndStatistics::limitAgeChildren, AGDataAndStatistics::limitAgeRetirement, peopleIncoming, and statData.
Referenced by generatePopulation().
|
private |
generates workpositions on the city's gates (entrances) for the outgoing work traffic.
N_out = N_in * (ProportionOut / (1 - ProportionOut)) = N_out = N_in * (Noutworkers / (Nworkers - Noutworkers))
Definition at line 130 of file AGCity.cpp.
References cityGates, AGDataAndStatistics::getPeopleYoungerThan(), AGDataAndStatistics::getRandomCityGateByOutgoing(), getStreet(), AGDataAndStatistics::limitAgeChildren, AGDataAndStatistics::limitAgeRetirement, AGDataAndStatistics::outgoingTraffic, statData, AGDataAndStatistics::unemployement, workPositions, and AGDataAndStatistics::workPositions.
Referenced by generateWorkPositions().
void AGCity::generatePopulation | ( | ) |
Definition at line 167 of file AGCity.cpp.
References generateIncomingPopulation(), AGDataAndStatistics::getPeopleOlderThan(), AGDataAndStatistics::getPeopleYoungerThan(), AGDataAndStatistics::getPoissonsNumberOfChildren(), AGDataAndStatistics::households, households, AGDataAndStatistics::inhabitants, AGDataAndStatistics::limitAgeChildren, AGDataAndStatistics::limitAgeRetirement, AGDataAndStatistics::meanNbrChildren, nbrCars, RandHelper::rand(), statData, and streets.
Referenced by AGCity(), and AGActivityGen::importInfoCity().
void AGCity::generateWorkPositions | ( | ) |
Definition at line 103 of file AGCity.cpp.
References generateOutgoingWP(), statData, streets, workPositions, and AGDataAndStatistics::workPositions.
Referenced by AGCity(), and AGActivityGen::importInfoCity().
const AGStreet & AGCity::getRandomStreet | ( | ) |
returns a random street
Definition at line 425 of file AGCity.cpp.
References RandHelper::getRandomFrom(), and streets.
Referenced by AGCity(), AGActivities::generateRandomTraffic(), AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().
const AGStreet & AGCity::getStreet | ( | const std::string & | edge | ) |
manipulation functions
verify if it is the first time this function is called in this case, we have to complete the streets with the network edges this means that streets are completely loaded (no any more to be read from stat-file)
Definition at line 400 of file AGCity.cpp.
References completeStreets(), AGDataAndStatistics::consolidateStat(), statData, streets, and streetsCompleted.
Referenced by AGCity(), generateOutgoingWP(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseCityGates(), and AGActivityGenHandler::parseSchool().
void AGCity::schoolAllocation | ( | ) |
Definition at line 269 of file AGCity.cpp.
References households.
Referenced by AGCity(), and AGActivityGen::importInfoCity().
void AGCity::workAllocation | ( | ) |
people from the city
people from outside
Definition at line 290 of file AGCity.cpp.
References AGDataAndStatistics::AdultNbr, OptionsCont::getBool(), OptionsCont::getOptions(), households, peopleIncoming, statData, AGDataAndStatistics::workPositions, and workPositions.
Referenced by AGCity(), and AGActivityGen::importInfoCity().
std::list<AGBusLine> AGCity::busLines |
Definition at line 91 of file AGCity.h.
Referenced by completeBusLines(), AGActivities::generateActivityTrips(), and AGActivityGenHandler::parseBusLine().
std::vector<AGPosition> AGCity::cityGates |
Definition at line 93 of file AGCity.h.
Referenced by AGActivities::generateInOutTraffic(), generateOutgoingWP(), and AGActivityGenHandler::parseCityGates().
std::list<AGHousehold> AGCity::households |
Definition at line 92 of file AGCity.h.
Referenced by carAllocation(), AGActivities::generateActivityTrips(), generatePopulation(), schoolAllocation(), and workAllocation().
|
private |
Definition at line 115 of file AGCity.h.
Referenced by carAllocation(), and generatePopulation().
|
private |
Definition at line 108 of file AGCity.h.
Referenced by completeStreets().
std::list<AGAdult> AGCity::peopleIncoming |
Definition at line 94 of file AGCity.h.
Referenced by generateIncomingPopulation(), AGActivities::generateInOutTraffic(), and workAllocation().
std::list<AGSchool> AGCity::schools |
Definition at line 90 of file AGCity.h.
Referenced by AGHousehold::allocateChildrenSchool(), AGActivityGenHandler::parseSchool(), and AGHousehold::regenerate().
AGDataAndStatistics& AGCity::statData |
Definition at line 87 of file AGCity.h.
Referenced by AGHousehold::allocateAdultsWork(), carAllocation(), completeStreets(), generateIncomingPopulation(), AGActivities::generateInOutTraffic(), generateOutgoingWP(), AGHousehold::generatePeople(), generatePopulation(), AGActivities::generateRandomTraffic(), AGActivities::generateTrips(), generateWorkPositions(), getStreet(), AGActivityGen::importInfoCity(), AGHousehold::isCloseFromPubTransport(), AGActivityGenHandler::parseBracket(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseCityGates(), AGActivityGenHandler::parseClosingHour(), AGActivityGenHandler::parseGeneralCityInfo(), AGActivityGenHandler::parseOpeningHour(), AGActivityGenHandler::parseParameters(), AGActivityGenHandler::parseStation(), AGHousehold::regenerate(), AGHousehold::retiredHouseholders(), AGActivityGen::varDepTime(), and workAllocation().
std::vector<AGStreet*> AGCity::streets |
Definition at line 88 of file AGCity.h.
Referenced by completeStreets(), generatePopulation(), generateWorkPositions(), getRandomStreet(), getStreet(), and AGActivityGenHandler::parseStreets().
|
private |
false until the function completeStreets is called this function completes streets and turn this parameter to true
Definition at line 113 of file AGCity.h.
Referenced by completeStreets(), and getStreet().
std::vector<AGWorkPosition> AGCity::workPositions |
Definition at line 89 of file AGCity.h.
Referenced by AGHousehold::allocateAdultsWork(), generateOutgoingWP(), generateWorkPositions(), AGHousehold::regenerate(), and workAllocation().