Jim, the MASON scheduler, like most such schedulers, maintains two
measures of temporal progress:
- the simulation timestamp -- what "time" it is right now in the
simulation world (not the real world). That's time().
- the number of times the schedule has pulsed. That's getSteps().
When you schedule an agent on the schedule, it is scheduled to be
fired at a given timestamp. The schedule iterates as follows:
1. Determine the timestamp of the minimum-time-scheduled agent
2. Advance the time to that timestamp (this is what time() returns)
3. Extract all agents scheduled for that timestamp
4. Sort them by ordering, and shuffle those with the same ordering
relative to one another
5. step() each of them in the order determined by #4
6. Increment the number of steps (this is what getSteps() returns)
7. Go to 1
The timestamp can be any real-valued number. The steps are obviously
integers (longs). If you need a measure of "simulation time", you
want to use time(). But keep in mind that this is a _discrete_event_
simulator. If nothing is scheduled for time 3.14159, the schedule
will never advance to that time -- it'll just skip past it up to the
next scheduled-for time.
On Jan 9, 2007, at 2:10 PM, Jimmy Ong wrote:
>> schedule.time() will return the current timestamp.
> Could you kindly elaborate more? I don't quite understand how time()
> would help in the problem scenario. Rather, how would one use time
> () in an
> agent's step method?
> It seems to me that time() and getSteps() always return the same
> value, no?
> Please advise.