Subject: Re: Change in scheduling changes behavior of time vs. step?
From: Sean Luke <[log in to unmask]>
Reply-To: MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date: Thu, 6 Sep 2007 21:29:42 -0400
On Sep 6, 2007, at 6:20 PM, Maciej M. Latek wrote:
> Please excuse me my ignorance, but I feel confused about definitions
> of time and step. If we obtain double time = schedule.time() and long
> step = schedule.getSteps(), there needs not to be any strict relation
> between those two (apart some positive correlation): with 10 agents
> scheduled to be activated at some randomized moments coming from
> U[0,1], querying for steps just before termination will return 10,
> while time might have not progressed much at all.
Correct. But Bruno was right, something had changed, and incorrectly
Here's how it's *supposed* to work. Each iteration of the Schedule,
it does the following:
0. Identify the lowest timestamp scheduled in the Schedule.
1. Pull out all Steppables registered that timestamp.
2. Sort those Steppables as follows:
- Steppables registered with a lower ordering go first
- Ties are broken either at random, or in order that the Steppables
were originally submitted to the Schedule.
3. Move the time forward to reflect the timestamp.
4. Step each Steppable in turn
5. Throw the Steppables away
6. Increment the step counter
Thus clearly the timestamp rate of change can be totally different,
and indeed nonlinear, from the step counter. But many people
schedule things to repeat exactly per timestep, so the timestamps
appear to reflect exactly the number of steps (well, they appear to
be one off).