Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGDataAndStatistics Class Reference

#include <AGDataAndStatistics.h>

Public Member Functions

void consolidateStat ()
double getInverseExpRandomValue (double mean, double maxVar)
int getPeopleOlderThan (int age)
int getPeopleYoungerThan (int age)
int getPoissonsNumberOfChildren (double mean)
double 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, int > ageSpan
std::map< int, double > beginWorkHours
std::map< int, AGPositionbusStations
double carPreference
double carRate
double departureVariation
std::map< int, double > endWorkHours
double factorInhabitants
double factorWorkPositions
double freeTimeActivityRate
int hhFarFromPT
int households
int householdsNbr
std::map< int, double > incoming
int incomingTraffic
int inhabitants
double laborDemand
int limitAgeChildren
int limitAgeRetirement
int limitEndAge
double maxFootDistance
double meanNbrChildren
double oldAgeHhProb
std::map< int, double > outgoing
int outgoingTraffic
std::map< int, double > population
double secondPersProb
double speedTimePerKm
double unemployement
double uniformRandomTrafficRate
int workPositions

Private Member Functions

 AGDataAndStatistics ()
int factorial (int n)
void normalizeMapProb (std::map< int, double > *myMap)
double poisson (double mean, int occ)

Detailed Description

Definition at line 38 of file AGDataAndStatistics.h.

Constructor & Destructor Documentation

◆ AGDataAndStatistics()

AGDataAndStatistics::AGDataAndStatistics ( )
inlineprivate

Definition at line 162 of file AGDataAndStatistics.h.

Referenced by getDataAndStatistics().

Here is the caller graph for this function:

Member Function Documentation

◆ consolidateStat()

void AGDataAndStatistics::consolidateStat ( )

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

Definition at line 98 of file AGDataAndStatistics.cpp.

References beginWorkHours, endWorkHours, getPeopleOlderThan(), getPeopleYoungerThan(), households, incoming, limitAgeChildren, limitAgeRetirement, limitEndAge, meanNbrChildren, normalizeMapProb(), oldAgeHhProb, outgoing, population, and secondPersProb.

◆ factorial()

int AGDataAndStatistics::factorial ( int n)
private

recursive mathematical function returning the factorial of n: n!

Definition at line 90 of file AGDataAndStatistics.cpp.

References factorial().

Referenced by factorial(), and poisson().

Here is the caller graph for this function:

◆ getDataAndStatistics()

AGDataAndStatistics & AGDataAndStatistics::getDataAndStatistics ( )
static

Definition at line 39 of file AGDataAndStatistics.cpp.

References AGDataAndStatistics().

◆ getInverseExpRandomValue()

double AGDataAndStatistics::getInverseExpRandomValue ( double mean,
double maxVar )

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

References RandHelper::rand().

◆ getPeopleOlderThan()

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

References getPeopleYoungerThan(), and inhabitants.

Referenced by consolidateStat().

Here is the caller graph for this function:

◆ getPeopleYoungerThan()

int AGDataAndStatistics::getPeopleYoungerThan ( int age)

Definition at line 135 of file AGDataAndStatistics.cpp.

References getPropYoungerThan(), and inhabitants.

Referenced by consolidateStat(), and getPeopleOlderThan().

Here is the caller graph for this function:

◆ getPoissonsNumberOfChildren()

int AGDataAndStatistics::getPoissonsNumberOfChildren ( double 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 72 of file AGDataAndStatistics.cpp.

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

◆ getPropYoungerThan()

double AGDataAndStatistics::getPropYoungerThan ( int age)

Definition at line 115 of file AGDataAndStatistics.cpp.

References population.

Referenced by getPeopleYoungerThan(), and getRandomPopDistributed().

Here is the caller graph for this function:

◆ getRandom()

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

References n, and RandHelper::rand().

◆ getRandomCityGateByIncoming()

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

References incoming, and RandHelper::rand().

◆ getRandomCityGateByOutgoing()

int AGDataAndStatistics::getRandomCityGateByOutgoing ( )

Definition at line 196 of file AGDataAndStatistics.cpp.

References outgoing, and RandHelper::rand().

◆ getRandomPopDistributed()

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

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

Referenced by AGHousehold::generatePeople().

Here is the caller graph for this function:

◆ normalizeMapProb()

void AGDataAndStatistics::normalizeMapProb ( std::map< int, double > * myMap)
private

Definition at line 145 of file AGDataAndStatistics.cpp.

Referenced by consolidateStat().

Here is the caller graph for this function:

◆ poisson()

double AGDataAndStatistics::poisson ( double 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 85 of file AGDataAndStatistics.cpp.

References factorial().

Referenced by getPoissonsNumberOfChildren().

Here is the caller graph for this function:

Field Documentation

◆ AdultNbr

int AGDataAndStatistics::AdultNbr

numbers not needed but interesting for statistics and TESTING

Definition at line 101 of file AGDataAndStatistics.h.

◆ ageSpan

std::map<int, int> AGDataAndStatistics::ageSpan

Definition at line 69 of file AGDataAndStatistics.h.

◆ beginWorkHours

std::map<int, double> AGDataAndStatistics::beginWorkHours

Definition at line 64 of file AGDataAndStatistics.h.

Referenced by consolidateStat(), and AGWorkPosition::generateOpeningTime().

◆ busStations

std::map<int, AGPosition> AGDataAndStatistics::busStations

Definition at line 66 of file AGDataAndStatistics.h.

◆ carPreference

double AGDataAndStatistics::carPreference

Definition at line 44 of file AGDataAndStatistics.h.

◆ carRate

double AGDataAndStatistics::carRate

Definition at line 54 of file AGDataAndStatistics.h.

◆ departureVariation

double AGDataAndStatistics::departureVariation

Definition at line 62 of file AGDataAndStatistics.h.

◆ endWorkHours

std::map<int, double> AGDataAndStatistics::endWorkHours

Definition at line 65 of file AGDataAndStatistics.h.

Referenced by consolidateStat(), and AGWorkPosition::generateClosingTime().

◆ factorInhabitants

double AGDataAndStatistics::factorInhabitants

Definition at line 82 of file AGDataAndStatistics.h.

◆ factorWorkPositions

double AGDataAndStatistics::factorWorkPositions

Definition at line 83 of file AGDataAndStatistics.h.

◆ freeTimeActivityRate

double AGDataAndStatistics::freeTimeActivityRate

Definition at line 60 of file AGDataAndStatistics.h.

◆ hhFarFromPT

int AGDataAndStatistics::hhFarFromPT

Definition at line 104 of file AGDataAndStatistics.h.

◆ households

int AGDataAndStatistics::households

Definition at line 50 of file AGDataAndStatistics.h.

Referenced by consolidateStat().

◆ householdsNbr

int AGDataAndStatistics::householdsNbr

Definition at line 102 of file AGDataAndStatistics.h.

◆ incoming

std::map<int, double> AGDataAndStatistics::incoming

number of incoming or outgoing people through the given city gates PROPORTION: it should be normalized

Definition at line 75 of file AGDataAndStatistics.h.

Referenced by consolidateStat(), and getRandomCityGateByIncoming().

◆ incomingTraffic

int AGDataAndStatistics::incomingTraffic

Definition at line 58 of file AGDataAndStatistics.h.

◆ inhabitants

int AGDataAndStatistics::inhabitants

from General element from XML file.

Definition at line 49 of file AGDataAndStatistics.h.

Referenced by getPeopleOlderThan(), and getPeopleYoungerThan().

◆ laborDemand

double AGDataAndStatistics::laborDemand

Definition at line 56 of file AGDataAndStatistics.h.

◆ limitAgeChildren

int AGDataAndStatistics::limitAgeChildren

Definition at line 51 of file AGDataAndStatistics.h.

Referenced by consolidateStat(), and AGHousehold::generatePeople().

◆ limitAgeRetirement

int AGDataAndStatistics::limitAgeRetirement

Definition at line 52 of file AGDataAndStatistics.h.

Referenced by consolidateStat(), and AGHousehold::generatePeople().

◆ limitEndAge

int AGDataAndStatistics::limitEndAge

◆ maxFootDistance

double AGDataAndStatistics::maxFootDistance

Definition at line 57 of file AGDataAndStatistics.h.

◆ meanNbrChildren

double AGDataAndStatistics::meanNbrChildren

Definition at line 94 of file AGDataAndStatistics.h.

Referenced by consolidateStat().

◆ oldAgeHhProb

double AGDataAndStatistics::oldAgeHhProb

data used for household generation has to be computed before.

Definition at line 90 of file AGDataAndStatistics.h.

Referenced by consolidateStat().

◆ outgoing

std::map<int, double> AGDataAndStatistics::outgoing

Definition at line 76 of file AGDataAndStatistics.h.

Referenced by consolidateStat(), and getRandomCityGateByOutgoing().

◆ outgoingTraffic

int AGDataAndStatistics::outgoingTraffic

Definition at line 59 of file AGDataAndStatistics.h.

◆ population

std::map<int, double> AGDataAndStatistics::population

Definition at line 68 of file AGDataAndStatistics.h.

Referenced by consolidateStat(), and getPropYoungerThan().

◆ secondPersProb

double AGDataAndStatistics::secondPersProb

Definition at line 92 of file AGDataAndStatistics.h.

Referenced by consolidateStat().

◆ speedTimePerKm

double AGDataAndStatistics::speedTimePerKm

parameters

Definition at line 43 of file AGDataAndStatistics.h.

◆ unemployement

double AGDataAndStatistics::unemployement

Definition at line 55 of file AGDataAndStatistics.h.

◆ uniformRandomTrafficRate

double AGDataAndStatistics::uniformRandomTrafficRate

Definition at line 61 of file AGDataAndStatistics.h.

◆ workPositions

int AGDataAndStatistics::workPositions

computed values used during processing

Definition at line 81 of file AGDataAndStatistics.h.

Referenced by AGWorkPosition::AGWorkPosition(), and AGWorkPosition::AGWorkPosition().


The documentation for this class was generated from the following files: