コード例 #1
0
ファイル: R1M.java プロジェクト: gsavin/antco2
  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");
  }