swarm-support
[Top][All Lists]
Advanced

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

Re: help: how to access simulation time value


From: Doug Donalson;
Subject: Re: help: how to access simulation time value
Date: Mon, 26 Jan 1998 22:18:28 -0800 (PST)

I think this code should work?

timeval_t timeOfAction,actionAtTime; 
id index;

index = [eventSchedule begin: [self getZone] ];
  while ( (actionAtTime = [index next]) )
     timeOfAction = (timeval_t) [index getKey];// key of member is time value

This should go through each action in the schedule.  The first is the 
present time.  This is actually a fragment of code from the 2-tier
asynchronous schedule algorythm that I use.  But I think it should
work for a synchronous schedule as well?

Let me know.

Cheers,

   D3



***************************************************************************
* Doug Donalson                          * Office: (805) 893-2962         *
* Ecology, Evolution, and Marine Biology * Home:   (805) 961-4447         *
* UC Santa Barbara                       * email address@hidden
* Santa Barbara Ca. 93106                *                                *
***************************************************************************
*                                                                         *
*   The most exciting phrase to hear in science, the one that             *
*   heralds new discoveries, is not "EUREKA" (I have found it) but        *
*   "That's funny ...?"                                                   *
*                                                                         *
*       Isaac Asimov                                                      *
*                                                                         *
***************************************************************************


On Mon, 26 Jan 1998, Geoffrey Schultz wrote:

> Is there a pre-packaged routine to access the current time value for a
> simulation?  If not, how can it be done otherwise?
> 
> Thanks,
> 
> 
> Geoff Schultz
>  
> 
> 
>                   ==================================
>    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.
>                   ==================================
> 

                  ==================================
   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]