[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Inter-agent communication in Discrete2d
From: |
John Langley |
Subject: |
Inter-agent communication in Discrete2d |
Date: |
Fri, 10 May 2002 09:42:22 +0100 (GMT) |
Hi,
I have agent running around on a Discrete2d object.
I would like to have them access each others variables when they bump
into each other, using this kind of approach:
-(int)someMethod
{
return somePointer;
}
I cannot find a way of getting one agent to send a message directly to
another agent, based on grid reference, and be returned some internal
value, e.g. somePointer.
It is possible for one agent to check if a neighbouring cell is occupied
by e.g.:
if ([world getObjectAtX: newX Y: newY] = 1 -> 'cell occupied'
if ([world getObjectAtX: newX Y: newY] = nil -> 'cell empty'
Where 'world' is the pointer, or 'id' to Discrete2d.
The getObjectAtX: xPos Y:yPos method only allows an agent to detect if
there is another agent at some other position, but apparently does not
allow returning of internal values from methods.
Is there a way in Discrete2d of having one object send a message directly
to another at some grid reference?
Any help greatfully received.
Regards,
John Langley.
==================================
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.
- Inter-agent communication in Discrete2d,
John Langley <=