Commit 9165f51a authored by Antoine's avatar Antoine

Ok.

parent 82cd829b
......@@ -576,9 +576,10 @@ public class BoidGraph extends AdjacencyListGraph {
@Override
protected void addNodeCallback(AbstractNode node) {
Boid b = (Boid) node;
b.getSpecies().register(b);
super.addNodeCallback(node);
AbstractNode n = getNode(b.getId());
b.getSpecies().register(b);
for (BoidGraphListener listener : listeners) {
listener.boidAdded(b);
......
......@@ -324,7 +324,9 @@ public class BoidSpecies implements Iterable<Boid> {
uiClass = uiClass.replaceAll("(^|\\s)" + name + "($|\\s)", " ");
uiClass = uiClass.trim();
b.setAttribute("ui.class", uiClass);
if(uiClass.length() == 0 )
b.removeAttribute("ui.class");
else b.setAttribute("ui.class", uiClass);
}
}
}
......@@ -335,7 +337,6 @@ public class BoidSpecies implements Iterable<Boid> {
* @param time The current boid graph time.
*/
public void terminateStep(double time) {
System.err.printf("## pop for %s%n", getName());
pop.step(time);
}
......
......@@ -154,7 +154,6 @@ public class DemographicManager implements BoidGraphListener {
b = futureParents.poll();
String id = b.getSpecies().createNewId();
System.err.printf(" -> adding boid %s%n", id);
ctx.addNode(id);
// ctx.addBoid(b.getSpecies(), b.getPosition().x, b.getPosition().y, b
// .getPosition().z);
......@@ -181,8 +180,6 @@ System.err.printf(" -> adding boid %s%n", id);
}
}
System.err.printf("Preparing to remove %d boids and add %d boids.%n", toRemove.size(), futureParents.size());
makeLove();
killAll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment