[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Swarm-Support] Observer Swarm Not updating
From: |
Williamson, Robert J |
Subject: |
[Swarm-Support] Observer Swarm Not updating |
Date: |
Tue, 24 Nov 2009 00:23:36 -0500 |
I'm having trouble getting my observer swarm to correctly update.
There are three obvious problems, that likely have the same root. I believe
it's something i'm just not grasping about the library.
1) I have a grid2dImpl that holds resources at each space. I want to display
the amount of resources on the "world", much like heat is displayed in the
HeatBugs simulation. The only discernible difference i have found between my
code and the HeatBugs code is that I am using a grid2dImpl while HeatBug uses a
Diffuse2dImpl. However, teh resources are not painted on the grid.
2) Only the the initial agents created at the model start-up are drawn on the
world. New ones are being created, i can see that the ArrayList of agents is
growing, but they are not being drawn.
3) I have an EZgraph plotting the population average of some parameter. The
graph is also only using the initial population to get the average, my getter
method for the parameter of interest does not even seem to be being called on
newly created Agents.
To get the Agent list i have tried just passing the Selector my getAgents()
method, and also having a running list in the ObserverSwarm that gets
continuously updated (in the _update_ method i call getAgents() and assign the
result to the list). However the results are the same in both instances.
I have tried looking up ways to do dynamic populations in Swarm, but haven't
found much help. I considered making hierarchical swarms as suggested in this
(http://www.swarm.org/pipermail/support/1999-November/007315.html) post, but
this seems to be over complicating matters; especially since this looks like it
is just an observer swarm issue.
I'm just looking for suggestions on this, or general suggestions on better ways
to work a dynamic population simulation.
this is my basic current architecture:
ObserverSwarm ----> ModelSwarm --has Many--> Species --has many--> Agents
ModelSwarm has the getAgents() method that gets the list of Agents from each
Species and compiles them into one ArrayList, that the ModelSwarm then returns.
I'm using Java.
Robert Williamson
Applied Biology/Software Engineering
Rose-Hulman Institute of Technology
CM# 909
432-294-0088
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Swarm-Support] Observer Swarm Not updating,
Williamson, Robert J <=