swarm-support
[Top][All Lists]
Advanced

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

RE: getCurrentTime()


From: glen e. p. ropella
Subject: RE: getCurrentTime()
Date: Fri, 28 Mar 1997 06:19:13 -0700

> I don't know (or have forgotten about) a message
> getCurrentTime.  To what object is it sent?
> Does it do what I (and Sven, I gather) want with respect
> to pre-activity time?  
> 
> Anyway, I guess I still like a macro approach, so that
> I don't have to worry about which object to send the message to,
> making sure that object is accessible from various
> other objects/files, etc.
> Of course I could write my own macro, perhaps.
> Still, it seems like such a basic, oft-used piece of info,
> it would be nice to have simple access to it "built-in".
> (I even wish I didn't have to include activity.h to get it.)
>  - r
> 
> ps But I'll admit I've not even thought about what happens
>    with complex models with schedules all over the place.

Ahhh, now I understand where the difficulty lies.  And I apologize
for being too terse earlier.

The macro is for getting the time for the activity in which one
is running.  It's like looking at one's watch to find out what
time it is.  It gets time as if there is only one clock by which
to get that time.

The message "getCurrentTime," which any ScheduleActivity accepts,
is a way of asking an activity what time it has.  (Note that this
is different from asking a Schedule for the relative time.  That's
another issue.)  Since activities are separately instantiable 
objects, it's reasonable to think that the "currentTime" state
variable could be different in two different activities.

So, when an activity is running, and the agent that is asking for the
time resides within the purview of that running activity, it makes
sense to ask for the absolute (or *seemingly* absolute) time with a
"getCurrentTime()" macro without specifying which activity you're
asking.  Any reasonable query for time should probably intend to ask
the activity in which one is running.  (It would be silly for me to
say to Bob, "What time is it?" and have him respond with some absolute
time as if we were on Alpha Centauri, which is in a moving inertial
frame with respect to this one. [grin])

Of course, if I'm God, however, and I ask the general, un-directed
question, "What time is it?"  Well, then you have to wonder which
activity I'm talking about, since God is "outside of time."

Does that make it clearer why I consider the present functionality
more "correct" than the previous?

glen
p.s. Sorry for the references to relativity and religion.... But,
one doesn't want the color of the conversation to become so bland
that disinterested parties aren't entertained, eh? [grin]


reply via email to

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