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