code: public int[] findBestUsingSampling(SequenceModel model, int numSamples, int sampleInterval, int[] initialSequence) {
      List samples = collectSamples(model, numSamples, sampleInterval, initialSequence);
      int[] best = null;
      double bestScore = Double.NEGATIVE_INFINITY;
      for (int i = 0; i < samples.size(); i++) {
        int[] sequence = (int[]) samples.get(i);
        double score = model.scoreOf(sequence);
        if (score>bestScore) {
          best = sequence;
          bestScore = score;
          System.err.println("found new best ("+bestScore+")");
          System.err.println(ArrayMath.toString(best));
        }
      }
      return best;
    }
docs: Finds the best sequence by collecting numSamples samples, scoring them, and then choosing
  the highest scoring sample.
  @return the array of type int representing the highest scoring sequence