swarm-support
[Top][All Lists]
Advanced

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

Re: getCurrentTime() broken ?


From: Rick Riolo
Subject: Re: getCurrentTime() broken ?
Date: Thu, 27 Mar 1997 20:36:15 -0500 (EST)

I ran into this, too, and I think it should
be considered broken.  Or if you want getCurrentTime()
to act the way it does now, then there should be another macro
that will return 0 before things have started and
return what getCurrentTime() does afterwards.

For example, I have methods to dipslay
the state of the model (agents, etc), including
the current time in that display.
I often want to use those methods to display the 
model state (to a report file, etc) just after initialization 
and before the model has started running.  
It used to be convenient that
I could do that with a simple call to getCurrentTime().

that's my 2p.

- r

Rick Riolo                       address@hidden
Program for Study of Complex Systems (PSCS)
1061 Randall Lab     University of Michigan
Ann Arbor MI 48109-1120
http://pscs.physics.lsa.umich.edu/PEOPLE/rlr-home.html

On Thu, 27 Mar 1997, Glen Ropella wrote:

> Date: Thu, 27 Mar 1997 18:15:36 -0700
> From: Glen Ropella <address@hidden>
> To: address@hidden
> Subject: Re: getCurrentTime() broken ?
> 
> Sven N. Thommesen wrote:
> 
>   I have perused the documentation for Swarm 1.0,
>   especially the sections on incompatibilities,
>   but haven't found anything on the following issue:
> 
>   In 1.0.x, if one calls -getCurrentTime() prior to
>   starting the simulation running, one now gets a
>   core dump with an error message to the effect that
>   no activity is currently active.
> 
>   In the beta version, the call just returned correct
>   time, namely 0.
> 
>   I'd GREATLY prefer if the old behavior was reinstated;
>   a core dump seems kinda rude ...
> 
>   Alternatively, how should I now code things to avoid
>   the core dump?
> 
>   Sven
> 
>    Hmmm.  You shouldn't just get a core dump.  You should get  a message
> 
> telling you that those macros are not valid if the activity is not
> running.
> 
> Try using the published message to anything that inherits from
> "ScheduleActivity".  As long as the activity has been created properly,
> 
> this should give you whatever value is in the variable.
> 
> BTW, I don't think we should go back to having valid macros before the
> activity is started.  The whole idea is to have an "out of context"
> message
> when the macro is used out of context.  However, it might be open to
> debate as to whether or not, when the activity is "stopped" (as opposed
> to
> "initialized" ), the macro report the last valid time.
> 
> --
> +-------------------------------------------------------------------------+
> |glen e. p. ropella (address@hidden)
> |                                  |
> |Hive Drone, SFI Swarm Project         |            Hail
> Eris!            |
> |http://www.trail.com/~gepr/home.html
> |                                  |
> +-------------------------------------------------------------------------+
> 
> 


reply via email to

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