swarm-support
[Top][All Lists]
Advanced

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

Multiple kinds of agents...


From: bleydorf
Subject: Multiple kinds of agents...
Date: Mon, 25 Aug 1997 15:38:39 -0400

All,
I started to send this to the Modeling list, but decided the support
list was a better home for it.
As I mentioned before, in my current "simple" simulation, (which I
borrowed heavily from heatbugs), I have two types of agents, problems
and solutions.  The problems will move about randomly searching for a
solution containing it's ideal number.  The solutions will be
stationary, but be able to move by being "picked-up" by the problems. 
Each problem will have a random ideal number assigned to it, and the
same with the solutions.  When a problem encounters a solution with a
number "closer" to its ideal value, it will pick it up and carry it with
it until if finds a solution closer (or equal) to the ideal value.  

My question:
How can a given agent "look" at other agents in the "world" and tell
them apart?  That is how can a Problem look at another agent and tell if
it's a problem or a solution?  I searched the "core" libraries for
possible answers, and only found (in Space) getObjectAtX:Y: and/or
getValueAtX:Y:, is this the way to go?  And if so, what is returned for
"getObjectAtX:Y:"?  I noticed in Heatbug.m, when it searches for a free
spot to move to, it uses a while loop, which looks until it doesn't find
a space which isn't nil, but what would the other values be?  I tried to
run a printf debugging routine and printing the output of the
"getObject..." and I only got what seemed to be random letters, or long
interger responses.  

I would like to assign status flags to each type of agent, and have the
ability to look at the status flag...maybe that would work...something
like:

[status getStatus[world getObjectatX: x Y: y]];
which would return a flag of the given agent and if it was one of the
solution flags then the calling agent would know its a solution...
But, if it was one of the problem flags then it would know its a
problem...

Has anyone done anything like this?  

Thanks,
Brad.

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