52 myOpeningTime(generateOpeningTime(*ds)),
53 myClosingTime(generateClosingTime(*ds)) {
85 for (std::map<int, SUMOReal>::const_iterator it = ds.
beginWorkHours.begin();
88 if (cumul >= choice) {
92 std::cout <<
"-- WARNING: work time distribution not complete (Sum(proportions) != 1): AUTODEFINED at 9.00am --" << std::endl;
101 for (std::map<int, SUMOReal>::const_iterator it = ds.
endWorkHours.begin();
104 if (cumul >= choice) {
108 std::cout <<
"-- WARNING: work time distribution not complete (Sum(proportions) != 1): AUTODEFINED at 5.00pm --" << std::endl;
135 throw (std::runtime_error(
"Work position already occupied. Cannot give it to another adult."));
void print() const
Prints out a summary of the properties of this class on standard output.
A location in the 2D plane freely positioned on a street.
static SUMOReal rand()
Returns a random real number in [0, 1)
std::map< int, SUMOReal > endWorkHours
A model of the street in the city.
AGWorkPosition(AGDataAndStatistics *ds, const AGStreet &inStreet)
An adult person who can have a job.
void lostWorkPosition()
Called when the adult has lost her job.
std::map< int, SUMOReal > beginWorkHours
AGPosition getPosition() const
static int generateOpeningTime(const AGDataAndStatistics &ds)
AGDataAndStatistics * myStatData
static int generateClosingTime(const AGDataAndStatistics &ds)