swarm-support
[Top][All Lists]
Advanced

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

Re: Probing: notification of target


From: Ken Cline
Subject: Re: Probing: notification of target
Date: Fri, 23 Jan 1998 15:59:42 -0500 (EST)

On Fri, 23 Jan 1998, Sven N. Thommesen wrote:
> 
> All: 
> 
> I have just gone through all the docs for probes in the 1.0.5 docs, and I
> don't see the immediate answer to a question I have, so I pass it on to the
> list in the hopes that someone has thought about this before:
> 
> Say I have a standard GUI probemap on the ModelSwarm open during execution.
> Say I alter a data value using the probe display. This will alter the
> relevant data field in the swarm object, but does the swarm object become
> cognizant of the fact that a change has taken place? Let's say that if a
> certain variable is altered, the ModelSwarm needs to propagate the change
> to other objects, or perhaps to destroy or create objects. How do I notify
> the target of a probe that a value has been changed ? (*)
> 
> As far as I can see, there is no builtin mechanism for this. I *could*
> define special messages on the target swarm to be used only by probes, but
> then I would need an object that would send those messages, and I'd need a
> gui probe on *that* object, and then the question is how does *that* object
> notice that a data variable has changed ...

On a previous project, my hack was to add internal variables
that mirrored those in the probeMap (or was it the other way
around?).

For example, I had "myVar" and "_myVar_".  Then, one of the
actions (on a repeating schedule) for relevant object/agents
was a message to the `assureIvarConsistency' method which
checked most of the ivars and reset them as necessary (eg
can't change an agent's name after creation).

This hack was less than satisfying and I would expect it to 
be computationally expensive for "large" agents.  Although,
it has the added advantage of possibly catching internal
errors as well as user interactions.

I suppose you could implement something like this for all
Swarm objects with some top level methods. It would be a
matter of duplicating the ivar list and, for each "internal"
ivar, you could add a struct that contained both the ivar
and the list of "constraints".  The "constraints" would most
likely be pointers to various functions that could do stuff
like range checking, etc.  Sounds like a lot of work. :)


Ken.

_________________________________________________________
Ken Cline                             address@hidden
SAIC                                 VOICE (410) 571-0413
Annapolis, MD                          FAX (301) 261-8427




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