And so there are two new GeomVectorField member functions: updateSpatialIndex() and scheduleSpatialIndexUpdater(). The former rebuilds the spatial index from the current set of geometry stored in the field. The latter is a convenience function for returning a Steppable that you can schedule to invoke updateSpatialIndex() with each time step.
public void start() {
super.start();
agents.clear(); // clear any existing agents from previous runs
addAgents();
agents.setMBR(buildings.getMBR());
// Ensure that the spatial index is made aware of the new agent
// positions. Scheduled to guaranteed to run after all agents moved.
schedule.scheduleRepeating( agents.scheduleSpatialIndexUpdater(), Integer.MAX_VALUE, 1.0 );
}
Yes, this hints that a new minor release of GeoMason is forthcoming. I've a few more loose ends to tie up before I finalizing it, though; I'm hoping to have it out the door by the end of the week.
--
[log in to unmask]