52 myOpeningTime(generateOpeningTime(*ds)),
53 myClosingTime(generateClosingTime(*ds)) {
85 for (std::map<int, double>::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, double>::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."));
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
static double rand()
Returns a random real number in [0, 1)
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)