public void compute() { super.compute(); if (graph instanceof AntCo2Graph) { AntCo2Graph ag = (AntCo2Graph) graph; double s = 0; for (Colony c : ag.getAntContext().eachColony()) s = max( s, (double) c.getMigrationCountForThisStep() / (double) c.getNodeCountAtStepBeginning()); m = s; } else throw new ClassCastException("graph is not a AntCo2Graph"); }