swarm-support
[Top][All Lists]
Advanced

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

Re: SWARM problems


From: pauljohn
Subject: Re: SWARM problems
Date: Fri, 26 Jun 1998 13:10:15 -0500 (CDT)

It is not quite clear where the problem is.

But, anyway, let me say this.  I encountered 2 similar issues, maybe
these ideas will lead in a good direction.
1. If agents are passing things back and forth, create a separate class
of object, embed that inside an agent, and write get and set methods so
they can deposit their objects in places where other agents can get
them.  My models have agents that have preferences, and preferences are
described by instances of another kind of object. So when they say "my
favorite is X" to one another, they do not pass themselves, they pass an
item from the class of policy points.  That way there is no circular
inclusion.

2.  Sometimes I've wished agents could directly message model swarm. 
ObserverSwarm can say
       [modelSwarm getData]
but I can't make the same work for agents like heatbugs. It causes a
circular inclusion of the sort you describe, I think.  The solution is
yet again to create another class of agent.  If you look in
the heatbugs example, instead of letting agents send messages to
modelSwarm, a heatspace is created that agents can send messages to and
find out the state of their environment.

Well, hope your project goes along nicely. When you have something,
please consider making it available.

pj
 

On 24 Jun, Laurence wrote:
> Hi,

> 
> 2) At the moment, the classes are written whereby each class is explicity
> typed. Eg. when class 'Receptor' signals class 'Enzyme_A', the receptor
> object is given a pointer (of type Enzyme_A) in order to send a message to
> the target.  In order to do this, the receptor class needs to include the
> header file for 'Enzyme_a'. This is because if I make the target pointer
> type id, I always get a compilation error.  However, I have the situation
> where the receptor signals Enzyme_A, which in turn signals Enzyme_b, which
> in turn signals the receptor.  By '#include'ing header files, the receptor
> header includes the enzyme_a header, which in turn includes the enzyme_b
> header, which in turn includes the receptor header -- hence, the receptor
> header is including itself effectively, and an error is produced!  Help!
> (Sorry if that doesn't read very clearly).
> 
> Best wishes, Laurence (address@hidden)
> ---------------------
> http://www.csc.liv.ac.uk/~laurence
> 
> 
>                   ==================================
>    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                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (913) 864-9086
Lawrence, Kansas 66045                FAX: (913) 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]