Commit 9165f51a authored by Antoine's avatar Antoine

Ok.

parent 82cd829b
...@@ -576,9 +576,10 @@ public class BoidGraph extends AdjacencyListGraph { ...@@ -576,9 +576,10 @@ public class BoidGraph extends AdjacencyListGraph {
@Override @Override
protected void addNodeCallback(AbstractNode node) { protected void addNodeCallback(AbstractNode node) {
Boid b = (Boid) node; Boid b = (Boid) node;
b.getSpecies().register(b);
super.addNodeCallback(node); super.addNodeCallback(node);
AbstractNode n = getNode(b.getId());
b.getSpecies().register(b);
for (BoidGraphListener listener : listeners) { for (BoidGraphListener listener : listeners) {
listener.boidAdded(b); listener.boidAdded(b);
......
...@@ -324,7 +324,9 @@ public class BoidSpecies implements Iterable<Boid> { ...@@ -324,7 +324,9 @@ public class BoidSpecies implements Iterable<Boid> {
uiClass = uiClass.replaceAll("(^|\\s)" + name + "($|\\s)", " "); uiClass = uiClass.replaceAll("(^|\\s)" + name + "($|\\s)", " ");
uiClass = uiClass.trim(); 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> { ...@@ -335,7 +337,6 @@ public class BoidSpecies implements Iterable<Boid> {
* @param time The current boid graph time. * @param time The current boid graph time.
*/ */
public void terminateStep(double time) { public void terminateStep(double time) {
System.err.printf("## pop for %s%n", getName());
pop.step(time); pop.step(time);
} }
......
...@@ -154,7 +154,6 @@ public class DemographicManager implements BoidGraphListener { ...@@ -154,7 +154,6 @@ public class DemographicManager implements BoidGraphListener {
b = futureParents.poll(); b = futureParents.poll();
String id = b.getSpecies().createNewId(); String id = b.getSpecies().createNewId();
System.err.printf(" -> adding boid %s%n", id);
ctx.addNode(id); ctx.addNode(id);
// ctx.addBoid(b.getSpecies(), b.getPosition().x, b.getPosition().y, b // ctx.addBoid(b.getSpecies(), b.getPosition().x, b.getPosition().y, b
// .getPosition().z); // .getPosition().z);
...@@ -181,8 +180,6 @@ System.err.printf(" -> adding boid %s%n", id); ...@@ -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(); makeLove();
killAll(); 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