swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] Swarm time


From: Paul E. Johnson
Subject: Re: [Swarm-Support] Swarm time
Date: Sun, 13 Apr 2003 18:45:43 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Look at the order of schedules in your activateIn statements. The order in which classes are activated determines the order in which they are told to do things at each timestep.

I recall an example where there were 3 classes, activated like

- activateIn: swarmContext
{
     [super activateIn: swarmContext];
    [modelSchedule1 activateIn: self];
    [modelSchedule2 activateIn: self];
 return [self getActivity];
}

If, by some quirk, your simulation is written so that objects who step in modelSchedudule1 happen to depend on things being finished from modelSchedule2, then it may appear that the modelSchedule1 is not doing anything at time 0. Then, at time 1, the modelSchedule2 things were done on the previous iteration, and then those things exist and the objects triggered by modelSchedule1 can find them and make some calculations. So to correct that problem, either some redesign was necessary, or we changed the method to



- activateIn: swarmContext
{
     [super activateIn: swarmContext];
    [modelSchedule2 activateIn: self];
    [modelSchedule1 activateIn: self];
 return [self getActivity];
}

Its funny, but when that problem arose, I remember thinking it was such an unusual quirk that I would never forget it. Now I can't even remember what program it came up in!

Good Luck

PJ



Li An wrote:

Hi Swarm folks,

I have a question with how Swarm counts the current time. As you know, you can get the time by using Globals.env.getCurrentTime(). If I set the simulation length to be 2 years, the program reports three times:

at year 0:....
at year 1, ...
at year 2, ...

Some of the results are not calculated at year 0, indicating the associated processes are not implemented, but some are.

What could be the problem?

Thanks,

Li
Li An
Department of Fisheries and Wildlife
13 Natural Resources Building



--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700




reply via email to

[Prev in Thread] Current Thread [Next in Thread]