We have a resource, X (might be stone, might be horses...)
iterate over (place, resource, day) {
resource_avail = (use ScottT's (or was it someone else's?) formulae,
based on a beginning amount + some incremental
addition);
total_shares = sum of productivity for each unit
competing for resource, where each unit's
productivity is based on time spent studying
times the number of men;
if (total_shares < resource_avail) {
divvy up the pot;
resource_avail -= total_shares;
} else {
base_unit = resource_avail / total_shares;
for each unit {
unit_share = base_unit * unit_productivity;
/* round down */
resource_avail -= unit_share;
}
}
}
In terms of the Olympia morning/noon/night parts of the day, the
resource_avail can be computed in the morning. total_shares are
accumlated over the course of the morning phase (order parsing). Then
at noon-time, the pot can be divvied up (or evening, whichever).
There. Shoot it down...
sc
--