docs: @Override
      public double[] buildNextGenes() {
          double[] result;
  
          boolean hasAlreadyBeenTried;
          int attemptsRemaining = MAX_NUM_GENERATION_ATTEMPTS;
          do {
              if (populationModel.isReadyToBreed()) {
                  result = buildOffspring();
              } else {
                  result = buildRandomGenes();
              }
  
              hasAlreadyBeenTried = hasAlreadyBeenTried(result);
              if (hasAlreadyBeenTried && --attemptsRemaining == 0) {
                  throw new GeneticGenerationException("Failed to generate a set of genes not already tried.");
              }
          } while (hasAlreadyBeenTried);
  
          previousGenes[previousGenesIdx] = result;
          previousGenesIdx = ++previousGenesIdx % previousGenes.length;
  
          return result;
      }