Exemplo n.º 1
0
  private void selectSplice() {
    // SELECT BEST HEURISTIC BOARDS

    // Trim off the worst boards.
    while (boards.size() > this.chooseBest) {
      boards.remove(boards.first());
    }

    // Add all boards to the "keep" list, then trim off the worst so we only
    // keep as many as the "keepBest" parameter.
    this.bestBoards.addAll(boards);
    while (bestBoards.size() > keepBest) {
      bestBoards.remove(bestBoards.first());
    }

    // REWIND BOARDS
    for (InfiniteBoard b : boards) {
      b.rewindBoard();
    }

    // SPLICE BOARDS
    spliceBoards(boards);
  }