Neighborhoods
I have a number of agents in my simulated world. When I retrieve the neighbors for one agent, and it says something like "Link (045F6968) is in my neibhborhood", how do I determine which agent (045F6968) refers to? Thanks!
|
breve: a 3d Simulation Environment for Multi-Agent Simulations and Artificial Life |
|
NavigationUser loginActive forum topicsSearch |
NeighborhoodsI have a number of agents in my simulated world. When I retrieve the neighbors for one agent, and it says something like "Link (045F6968) is in my neibhborhood", how do I determine which agent (045F6968) refers to? Thanks! |
Neighborhoods
By adding a variable such as an ID or Name for each object that you want to have detected, you can change your neighbor finding routine so that it grabs not only the object and its hash code, but the ID also.
Neighborhoods
I'm not sure I understand what the issue is, so perhaps you could explain a little more what you're trying to do.
When you get the list of neighbors, you can iterate through the list and perform computation with each neighbor. For an example of this, see the Swarm demos.
If you're trying to visually "see" what the neighbor is, perhaps you would want to iterate through the list and tell the other agents to change their color.
- jon
Neighborhoods
I have 8 Multibody agents in my simulation. Retrieving the list of neighbors for one of them gives me a list like this:
{ RatPupBall (022A7258) , RatPupWheel (03152BD0) , RatPupWheel (02277148) , Link (02241538) , Link (02250960) , Simbot_weight (022BDDD0) , Stationary (01AB9498) }
With the exception of Stationary, which is the floor, the rest of these objects correspond to one other agent, though if it happened to be in contact with more, the list would of course be longer and have different numbers/letters in parentheses. I have a measure of aggregation of these agents which requires that I know exactly which agent is in contact with which other agent. I know i could do this using one of the objects (like one of the links) making up the body of the contacted agent, and taking the number in parentheses to be a unique identifier, but for verification purposes it would be easier for me to have more intuitive identifiers.
Is there a way to do neighborhood detection that tells me of the presence of another whole agent, not just a collection of the objects that constitute it?
Per the previous suggestion, I attached a name to each agent, but neighborhood detection only retrieves nearby objects, not strings attached to them...is there an implementation I'm missing?
thanks!
Neighborhoods
when you get neighbors you get a list,then use a foreach loop
List=get neightbors.
foreach object in neightbors:
{
ID=object get-id.
print ID.
}
in your other code you put a acessor method which is basicly
+to get-id:
return ID.