swarm-support
[Top][All Lists]
Advanced

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

Re: Time management in Swarm


From: M Lang / S Railsback
Subject: Re: Time management in Swarm
Date: Thu, 05 Jul 2001 12:01:46 -0600

Olivier Jauze wrote:
> 
> Hi,
> 
> I would like to know how the time is manage in Swarm.
> 
> This is my aim :
> suppose the simulation begin at the 1 January of this year, it is the time
> 0 for the globals environment (Globals.env) .
> If I want to insert an event in the ModelSwarm at the 15 February of this
> same year, what is the way to do that ?

As I mentioned recently, Steve Jackson and I are finishing up a
TimeManager class that helps with this kind of stuff. It converts dates
or date-time values into the Unix time_t format (number of seconds since
1/1/70). I assume these time_t values could be used to put actions on
the schedule. So with our time manager you could do something like: 

[modelSchedule at: [timeManager getTimeTWithDate: "2/15/2001"]
createAction: yourFeb15Action];

Or you could use the TimeManager to get the number of days between two
dates, and use that number to schedule actions (so your model time is in
days, not seconds).

Please note that our TimeManager class is in Objective C; I have
documentation for it, and hope to complete the code within a week. 

Steve Railsback

-- 
address@hidden
Lang, Railsback & Assoc.
250 California Ave., Arcata CA 95521
707-822-0453; Fax 822-1868

Until July 1, 2001: 
        Los Alamos, NM
        505-661-4258

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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