SUMO - Simulation of Urban MObility
|
#include <AGDataAndStatistics.h>
Public Member Functions | |
void | consolidateStat () |
SUMOReal | getInverseExpRandomValue (SUMOReal mean, SUMOReal maxVar) |
int | getPeopleOlderThan (int age) |
int | getPeopleYoungerThan (int age) |
int | getPoissonsNumberOfChildren (SUMOReal mean) |
SUMOReal | getPropYoungerThan (int age) |
int | getRandom (int n, int m) |
int | getRandomCityGateByIncoming () |
int | getRandomCityGateByOutgoing () |
int | getRandomPopDistributed (int n, int m) |
Static Public Member Functions | |
static AGDataAndStatistics & | getDataAndStatistics () |
Data Fields | |
int | AdultNbr |
std::map< int, SUMOReal > | beginWorkHours |
std::map< int, AGPosition > | busStations |
SUMOReal | carPreference |
SUMOReal | carRate |
SUMOReal | departureVariation |
std::map< int, SUMOReal > | endWorkHours |
SUMOReal | factorInhabitants |
SUMOReal | factorWorkPositions |
SUMOReal | freeTimeActivityRate |
int | hhFarFromPT |
int | households |
int | householdsNbr |
std::map< int, SUMOReal > | incoming |
int | incomingTraffic |
int | inhabitants |
int | limitAgeChildren |
int | limitAgeRetirement |
int | limitEndAge |
SUMOReal | maxFootDistance |
SUMOReal | meanNbrChildren |
SUMOReal | oldAgeHhProb |
std::map< int, SUMOReal > | outgoing |
int | outgoingTraffic |
std::map< int, SUMOReal > | population |
SUMOReal | secondPersProb |
SUMOReal | speedTimePerKm |
SUMOReal | unemployement |
SUMOReal | uniformRandomTrafficRate |
int | workPositions |
Private Member Functions | |
AGDataAndStatistics () | |
int | factorial (int n) |
void | normalizeMapProb (std::map< int, SUMOReal > *myMap) |
SUMOReal | poisson (SUMOReal mean, int occ) |
Definition at line 48 of file AGDataAndStatistics.h.
|
inlineprivate |
Definition at line 170 of file AGDataAndStatistics.h.
void AGDataAndStatistics::consolidateStat | ( | ) |
function consolidating statistics: normalizes the maps with probabilities completes data which have to be computed before use
Definition at line 107 of file AGDataAndStatistics.cpp.
References beginWorkHours, endWorkHours, getPeopleOlderThan(), getPeopleYoungerThan(), households, incoming, limitAgeChildren, limitAgeRetirement, limitEndAge, meanNbrChildren, normalizeMapProb(), oldAgeHhProb, outgoing, population, secondPersProb, and SUMOReal.
Referenced by AGCity::getStreet(), and AGActivityGen::importInfoCity().
|
private |
recursive mathematical function returning the factorial of n: n!
Definition at line 99 of file AGDataAndStatistics.cpp.
Referenced by poisson().
|
static |
Definition at line 48 of file AGDataAndStatistics.cpp.
function returning a random value corresponding to this distribution: -mean is given -max variation of the mean (|possible value - mean| <= maxVar -the mean is the most probable -the probability distribution function is a "scaled exponential" distribution from mean-maxVar to mean and from mean to mean+maxVar
Definition at line 169 of file AGDataAndStatistics.cpp.
References RandHelper::rand(), and SUMOReal.
int AGDataAndStatistics::getPeopleOlderThan | ( | int | age | ) |
these functions return the number of people having more (or less) than the given age (inclusive for getPeopleOlderThan; exclusive for getPeopleYoungerThan) getPeopleOlderThan(n) + getPeopleYoungerThan(n) = inhabitants these first two function are based on the third one.
Definition at line 149 of file AGDataAndStatistics.cpp.
References getPeopleYoungerThan(), and inhabitants.
Referenced by AGCity::carAllocation(), consolidateStat(), and AGCity::generatePopulation().
int AGDataAndStatistics::getPeopleYoungerThan | ( | int | age | ) |
Definition at line 144 of file AGDataAndStatistics.cpp.
References getPropYoungerThan(), inhabitants, and SUMOReal.
Referenced by AGCity::completeStreets(), consolidateStat(), AGCity::generateOutgoingWP(), AGCity::generatePopulation(), and getPeopleOlderThan().
int AGDataAndStatistics::getPoissonsNumberOfChildren | ( | SUMOReal | mean | ) |
function evaluating the POISSON's lay (probability lay) it returns the number of children with a probability of POISSON in a household is given the mean of the distribution
TODO Consider reimplementation
Definition at line 81 of file AGDataAndStatistics.cpp.
References LIMIT_CHILDREN_NUMBER, poisson(), RandHelper::rand(), and SUMOReal.
Referenced by AGCity::generatePopulation().
SUMOReal AGDataAndStatistics::getPropYoungerThan | ( | int | age | ) |
Definition at line 124 of file AGDataAndStatistics.cpp.
References population, and SUMOReal.
Referenced by getPeopleYoungerThan(), and getRandomPopDistributed().
int AGDataAndStatistics::getRandom | ( | int | n, |
int | m | ||
) |
function returning a random number between the two given numbers: [n;m[ (m cannot occur) it returns 0 if m < n
Definition at line 54 of file AGDataAndStatistics.cpp.
References RandHelper::rand().
int AGDataAndStatistics::getRandomCityGateByIncoming | ( | ) |
function returning a random city gate corresponding to the distribution of the incoming/outgoing traffic In fact, it returns the position of a city gate in the citygate vector.
Definition at line 190 of file AGDataAndStatistics.cpp.
References incoming, RandHelper::rand(), and SUMOReal.
Referenced by AGActivities::generateInOutTraffic().
int AGDataAndStatistics::getRandomCityGateByOutgoing | ( | ) |
Definition at line 205 of file AGDataAndStatistics.cpp.
References outgoing, RandHelper::rand(), and SUMOReal.
Referenced by AGCity::generateOutgoingWP().
int AGDataAndStatistics::getRandomPopDistributed | ( | int | n, |
int | m | ||
) |
function returning a random age between the two numbers satisfying the previous constrains this number is in relation to the distribution of the population through the brackets (population's list) if the given numbers are both greater than limitEndAge, it returns 0 if m is greater than limitEndAge, m=limitEndAge returns -1 if conditions are not satisfied
Definition at line 64 of file AGDataAndStatistics.cpp.
References getPropYoungerThan(), limitEndAge, RandHelper::rand(), and SUMOReal.
Referenced by AGCity::generateIncomingPopulation(), and AGHousehold::generatePeople().
|
private |
Definition at line 154 of file AGDataAndStatistics.cpp.
References SUMOReal.
Referenced by consolidateStat().
returns the POISSON's probability (exp(-m)*m^k/k!)
TODO Create a Poisson distribution class for this. Or is it in Boost?
Definition at line 94 of file AGDataAndStatistics.cpp.
References factorial(), and SUMOReal.
Referenced by getPoissonsNumberOfChildren().
int AGDataAndStatistics::AdultNbr |
numbers not needed but interesting for statistics and TESTING
Definition at line 109 of file AGDataAndStatistics.h.
Referenced by AGCity::workAllocation().
std::map<int, SUMOReal> AGDataAndStatistics::beginWorkHours |
Definition at line 73 of file AGDataAndStatistics.h.
Referenced by consolidateStat(), AGWorkPosition::generateOpeningTime(), and AGActivityGenHandler::parseOpeningHour().
std::map<int, AGPosition> AGDataAndStatistics::busStations |
Definition at line 75 of file AGDataAndStatistics.h.
Referenced by AGActivity::availableTranspMeans(), AGCity::carAllocation(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseStation(), and AGActivity::possibleTranspMean().
SUMOReal AGDataAndStatistics::carPreference |
Definition at line 54 of file AGDataAndStatistics.h.
Referenced by AGActivityGenHandler::parseParameters().
SUMOReal AGDataAndStatistics::carRate |
Definition at line 64 of file AGDataAndStatistics.h.
Referenced by AGCity::carAllocation(), and AGActivityGenHandler::parseGeneralCityInfo().
SUMOReal AGDataAndStatistics::departureVariation |
Definition at line 71 of file AGDataAndStatistics.h.
Referenced by AGActivityGenHandler::parseParameters(), and AGActivityGen::varDepTime().
std::map<int, SUMOReal> AGDataAndStatistics::endWorkHours |
Definition at line 74 of file AGDataAndStatistics.h.
Referenced by consolidateStat(), AGWorkPosition::generateClosingTime(), and AGActivityGenHandler::parseClosingHour().
SUMOReal AGDataAndStatistics::factorInhabitants |
Definition at line 90 of file AGDataAndStatistics.h.
Referenced by AGCity::completeStreets().
SUMOReal AGDataAndStatistics::factorWorkPositions |
Definition at line 91 of file AGDataAndStatistics.h.
Referenced by AGCity::completeStreets().
SUMOReal AGDataAndStatistics::freeTimeActivityRate |
Definition at line 69 of file AGDataAndStatistics.h.
Referenced by AGActivityGenHandler::parseParameters().
int AGDataAndStatistics::hhFarFromPT |
Definition at line 112 of file AGDataAndStatistics.h.
Referenced by AGCity::carAllocation().
int AGDataAndStatistics::households |
Definition at line 60 of file AGDataAndStatistics.h.
Referenced by consolidateStat(), AGCity::generatePopulation(), and AGActivityGenHandler::parseGeneralCityInfo().
int AGDataAndStatistics::householdsNbr |
Definition at line 110 of file AGDataAndStatistics.h.
Referenced by AGCity::carAllocation().
std::map<int, SUMOReal> AGDataAndStatistics::incoming |
number of incoming or outgoing people through the given city gates PROPORTION: it should be normalized
Definition at line 83 of file AGDataAndStatistics.h.
Referenced by consolidateStat(), getRandomCityGateByIncoming(), and AGActivityGenHandler::parseCityGates().
int AGDataAndStatistics::incomingTraffic |
Definition at line 67 of file AGDataAndStatistics.h.
Referenced by AGCity::completeStreets(), AGCity::generateIncomingPopulation(), and AGActivityGenHandler::parseGeneralCityInfo().
int AGDataAndStatistics::inhabitants |
from General element from XML file.
Definition at line 59 of file AGDataAndStatistics.h.
Referenced by AGCity::completeStreets(), AGCity::generatePopulation(), getPeopleOlderThan(), getPeopleYoungerThan(), and AGActivityGenHandler::parseGeneralCityInfo().
int AGDataAndStatistics::limitAgeChildren |
Definition at line 61 of file AGDataAndStatistics.h.
Referenced by AGCity::carAllocation(), AGCity::completeStreets(), consolidateStat(), AGCity::generateIncomingPopulation(), AGCity::generateOutgoingWP(), AGHousehold::generatePeople(), AGCity::generatePopulation(), and AGActivityGenHandler::parseGeneralCityInfo().
int AGDataAndStatistics::limitAgeRetirement |
Definition at line 62 of file AGDataAndStatistics.h.
Referenced by AGCity::completeStreets(), consolidateStat(), AGCity::generateIncomingPopulation(), AGCity::generateOutgoingWP(), AGHousehold::generatePeople(), AGCity::generatePopulation(), AGActivityGenHandler::parseGeneralCityInfo(), AGFreeTime::possibleTypeOfTrip(), and AGHousehold::retiredHouseholders().
int AGDataAndStatistics::limitEndAge |
Definition at line 63 of file AGDataAndStatistics.h.
Referenced by consolidateStat(), AGHousehold::generatePeople(), and getRandomPopDistributed().
SUMOReal AGDataAndStatistics::maxFootDistance |
Definition at line 66 of file AGDataAndStatistics.h.
Referenced by AGActivity::availableTranspMeans(), AGHousehold::isCloseFromPubTransport(), AGActivityGenHandler::parseGeneralCityInfo(), and AGActivity::possibleTranspMean().
SUMOReal AGDataAndStatistics::meanNbrChildren |
Definition at line 102 of file AGDataAndStatistics.h.
Referenced by consolidateStat(), and AGCity::generatePopulation().
SUMOReal AGDataAndStatistics::oldAgeHhProb |
data used for household generation has to be computed before.
Definition at line 98 of file AGDataAndStatistics.h.
Referenced by consolidateStat().
std::map<int, SUMOReal> AGDataAndStatistics::outgoing |
Definition at line 84 of file AGDataAndStatistics.h.
Referenced by consolidateStat(), getRandomCityGateByOutgoing(), and AGActivityGenHandler::parseCityGates().
int AGDataAndStatistics::outgoingTraffic |
Definition at line 68 of file AGDataAndStatistics.h.
Referenced by AGCity::generateOutgoingWP(), and AGActivityGenHandler::parseGeneralCityInfo().
std::map<int, SUMOReal> AGDataAndStatistics::population |
Definition at line 77 of file AGDataAndStatistics.h.
Referenced by consolidateStat(), getPropYoungerThan(), and AGActivityGenHandler::parseBracket().
SUMOReal AGDataAndStatistics::secondPersProb |
Definition at line 100 of file AGDataAndStatistics.h.
Referenced by consolidateStat().
SUMOReal AGDataAndStatistics::speedTimePerKm |
parameters
Definition at line 53 of file AGDataAndStatistics.h.
Referenced by AGActivities::generateInOutTraffic(), and AGActivityGenHandler::parseParameters().
SUMOReal AGDataAndStatistics::unemployement |
Definition at line 65 of file AGDataAndStatistics.h.
Referenced by AGHousehold::allocateAdultsWork(), AGCity::completeStreets(), AGCity::generateOutgoingWP(), AGActivityGenHandler::parseGeneralCityInfo(), and AGHousehold::regenerate().
SUMOReal AGDataAndStatistics::uniformRandomTrafficRate |
Definition at line 70 of file AGDataAndStatistics.h.
Referenced by AGActivities::generateRandomTraffic(), and AGActivityGenHandler::parseParameters().
int AGDataAndStatistics::workPositions |
computed values used during processing
Definition at line 89 of file AGDataAndStatistics.h.
Referenced by AGWorkPosition::AGWorkPosition(), AGHousehold::allocateAdultsWork(), AGCity::completeStreets(), AGCity::generateOutgoingWP(), AGCity::generateWorkPositions(), AGWorkPosition::let(), AGHousehold::regenerate(), AGWorkPosition::take(), and AGCity::workAllocation().