SUMO - Simulation of Urban MObility
AGDataAndStatistics Class Reference

#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 AGDataAndStatisticsgetDataAndStatistics ()

Data Fields

int AdultNbr
std::map< int, SUMORealbeginWorkHours
std::map< int, AGPositionbusStations
SUMOReal carPreference
SUMOReal carRate
SUMOReal departureVariation
std::map< int, SUMORealendWorkHours
SUMOReal factorInhabitants
SUMOReal factorWorkPositions
SUMOReal freeTimeActivityRate
int hhFarFromPT
int households
int householdsNbr
std::map< int, SUMORealincoming
int incomingTraffic
int inhabitants
int limitAgeChildren
int limitAgeRetirement
int limitEndAge
SUMOReal maxFootDistance
SUMOReal meanNbrChildren
SUMOReal oldAgeHhProb
std::map< int, SUMORealoutgoing
int outgoingTraffic
std::map< int, SUMORealpopulation
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)

Detailed Description

Definition at line 48 of file AGDataAndStatistics.h.


Constructor & Destructor Documentation

Definition at line 170 of file AGDataAndStatistics.h.


Member Function Documentation

function consolidating statistics: normalizes the maps with probabilities completes data which have to be computed before use

Definition at line 120 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().

recursive mathematical function returning the factorial of n: n!

Definition at line 112 of file AGDataAndStatistics.cpp.

Referenced by poisson().

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 182 of file AGDataAndStatistics.cpp.

References RandHelper::rand(), and SUMOReal.

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 162 of file AGDataAndStatistics.cpp.

References getPeopleYoungerThan(), and inhabitants.

Referenced by AGCity::carAllocation(), consolidateStat(), and AGCity::generatePopulation().

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 91 of file AGDataAndStatistics.cpp.

References LIMIT_CHILDREN_NUMBER, poisson(), RandHelper::rand(), and SUMOReal.

Referenced by AGHousehold::generatePeople().

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().

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 203 of file AGDataAndStatistics.cpp.

References incoming, RandHelper::rand(), and SUMOReal.

Referenced by AGActivities::generateInOutTraffic().

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

alea = alea * total + beginProp =====> easier test than: alea < (getPropYoungerThan(a+1)-beginProp)/total

Definition at line 64 of file AGDataAndStatistics.cpp.

References getPropYoungerThan(), limitEndAge, RandHelper::rand(), and SUMOReal.

Referenced by AGCity::generateIncomingPopulation(), and AGHousehold::generatePeople().

void AGDataAndStatistics::normalizeMapProb ( std::map< int, SUMOReal > *  myMap) [private]

Definition at line 167 of file AGDataAndStatistics.cpp.

References SUMOReal.

Referenced by consolidateStat().

SUMOReal AGDataAndStatistics::poisson ( SUMOReal  mean,
int  occ 
) [private]

returns the POISSON's probability (exp(-m)*m^k/k!)

  • : mean of the distribution
  • : number of occurrences

TODO Create a Poisson distribution class for this. Or is it in Boost?

Definition at line 104 of file AGDataAndStatistics.cpp.

References factorial(), and SUMOReal.

Referenced by getPoissonsNumberOfChildren().


Field Documentation

numbers not needed but interesting for statistics and TESTING

Definition at line 109 of file AGDataAndStatistics.h.

Referenced by AGCity::workAllocation().

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().

data used for household generation has to be computed before.

Definition at line 98 of file AGDataAndStatistics.h.

Referenced by consolidateStat().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines