swarm-support
[Top][All Lists]
Advanced

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

Re: change in ProbeMap? in ActiveGraph?


From: Paul Johnson
Subject: Re: change in ProbeMap? in ActiveGraph?
Date: Fri, 2 Jan 1998 14:57:03 -0600 ()


Dear Rick:
  I ran into this early on and I got explanations from both Glen and
Marcus and Sven T.  The probemap is being treated like a protocol, rather
than a class, and it is done so (partly, at least) as part of a
forward-looking strategy of separating the gui stuff from the swarm sim
stuff. 

Marcus said originally:
MGD>  "I'd suggest finding "ProbeMap *" and changing it to be
MGD> "id <ProbeMap>"

I asked for more explanation, he said: 

"The first says "a pointer to a ProbeMap" (a particular frozen thing,
implying knowledge of the internal structure of a object type), and
the second says, "this object will communicate according to this
protocol".  We are moving in the direction of using the latter for
everything because it provides much more flexibility.  I suppose
somewhere in SwarmDom there is some propaganda about this, but I'm
not sure where, offhand.  The NEXTSTEP documentation talks about it.

The practical reason to use the "id <protocol> object" notation
is that if you use the Swarm advertised interface files, e.g. <simtools.h>
all you get is protocol declarations, and so you'll get those sorts
of warnings."

Sven said this:
"As for the last step with Probemap, the deal is that 'Probemap * x'
requires x to be an object of class Probemap, while 'id <Probemap> x'
allows x to be any kind of object that follows the Probemap protocol (i.e.
it implements all the methods required of that protocol). Since in Swarm
the create: methods are allowed to return different objects depending on
the parameters specified, the only way to make sure you are getting an
object with the right capabilities is to specify the protocol. The
Probemap
class, if it even exists, may not implement the Probemap protocol! Is the
confusion total now?"

pj


On Fri, 2 Jan 1998, Rick Riolo wrote:

> 
> I noticed this change in the new (1.0.1) HeatbugsObserverSwarm.m .
> 
> The old version had:
> 
> +createBegin: (id) aZone {
>   HeatbugObserverSwarm * obj;
>   ProbeMap * probeMap;
> 
> Its now:
> 
> +createBegin: (id) aZone {
>   HeatbugObserverSwarm * obj;
>   id <ProbeMap> probeMap;
> 
> I noticed this because we have a variant of Heatbugs here
> that I tried to make with the new swarm-1.0.4, and I got warnings:
> 
> HeatbugObserverSwarm.m: In function `_c_HeatbugObserverSwarm__createBegin_':
> HeatbugObserverSwarm.m:40: warning: `ProbeMap' does not respond to 
> `setProbedClass:'
> HeatbugObserverSwarm.m:41: warning: `ProbeMap' does not respond to `createEnd'
> HeatbugObserverSwarm.m:45: warning: `ProbeMap' does not respond to `addProbe:'
> 
> and some more like that.  
> My version of heatbugs worked just fine despite these warnings. 
> These warnings all disappeared when I changed from 
>   ProbeMap * probeMap;
> to
>   id <ProbeMap> probeMap;
> 
> So...
> What is the reason for that change?
> Is that indeed the explanation for the warnings I got, which disappeared?
> 
> -----------------------------------------------------------------------------
> Perhaps related to the above:
> In my variant of heatbugs, I use ActiveGraphs.
> Under previous swarms I didn't get warnings, but now I get these:
> 
> HeatbugObserverSwarm.m: In function 
> `_i_HeatbugObserverSwarm__buildObjectsArgC_ArgV_':
> HeatbugObserverSwarm.m:196: warning: `ActiveGraph' does not respond to 
> `setElement:'
> HeatbugObserverSwarm.m:197: warning: `ActiveGraph' does not respond to 
> `setDataFeed:'
> HeatbugObserverSwarm.m:198: warning: `ActiveGraph' does not respond to 
> `setProbedSelector:
> ...
> 
> I have some IVs defined:
>   Averager *IAvger, *OAvger;
>   GraphElement *IGraphElem, *OGraphElem;
>   ActiveGraph *IGrapher, *OGrapher;
> and the lines that generate the warnings above are:
>       IGrapher = [ActiveGraph createBegin: [self getZone]];
>       [IGrapher setElement: IGraphElem];
>       [IGrapher setDataFeed: IAvger];
>       [IGrapher setProbedSelector: M(getAverage)];
> 
> Again, the active graphs seem to work fine despite the warnings.
> 
> So...
> Is there some change I need to make to get rid of those warnings?
> Thanks!
> 
>  - r
> 
> Rick Riolo                           
> address@hidden Program for Study of Complex Systems (PSCS)
> 4068 Randall Lab                
> University of Michigan         Ann Arbor MI 48109-1120
> Phone: 313 763 3323                  Fax: 313 763 9267
> http://pscs.physics.lsa.umich.edu/PEOPLE/rlr-home.html
> http://pscs.physics.lsa.umich.edu//pscs.html
> 
> 
>                   ==================================
>    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.
>                   ==================================
> 

Paul E. Johnson                 address@hidden  
Associate Professor             http://lark.cc.ukans.edu/~pauljohn
Dept. of Political Science      Fax:   (913) 864-5700
University of Kansas            Phone: (913) 864-9086
Lawrence, Kansas 66045


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