swarm-support
[Top][All Lists]
Advanced

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

Re: reprise: interface declaration


From: Paul E Johnson
Subject: Re: reprise: interface declaration
Date: Thu, 12 Oct 2000 10:32:10 -0500

"Marcus G. Daniels" wrote:
> 
> So here are the changes I'd suggest.  The problem was that you had
> ModelSwarm.h included in the files below, which made the includes happen
> in a different order than you probably anticipated.  The only time you
> really ought to include a ModelSwarm in an agent type file is when
> you need the agent to seem some global state or do behind-the-scenes
> global bookkeeping, etc.

Maybe I can learn something from this example, then.  My ModelSwarm.[hm]
has a method in it called "getAgentList: (int) x" and whenever an agent
needs to know who is in his "group", he tells the model swarm to give it
to him.  Before that, the agent has a "setModelSwarm" method that gives
that agent a "handle" with which to refer to the model swarm object.  

So I don't see any way to avoid including ModelSwarm.h in the agent
file, but I worry that the problem Daniel ran into might someday happen
to me.  

It never occurred to me to wonder about the order in which objects are
compiled.  If I have Agent.m that imports ModelSwarm.h, and ModelSwarm.m
that imports Agent.h, I've not had trouble yet.  What in his example was
causing the trouble?

I can't download bandarch.zip from incoming because of permissions, but
I will if you think it is instructive and put it somewhere I can get
it.  If you just tell me the rule of thumb, though, I will be just as
happy.

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

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