Exemplo n.º 1
0
  public void setData(double crossoverRate, populationI originalPop) {
    this.originalPop = originalPop;
    popSize = originalPop.getPopulationSize();
    // System.out.println("originalPop.getLengthOfChromosome()
    // "+originalPop.getLengthOfChromosome());
    newPop = new population();
    newPop.setGenotypeSizeAndLength(
        originalPop.getEncodedType(),
        popSize,
        originalPop.getLengthOfChromosome(),
        originalPop.getNumberOfObjectives());
    newPop.initNewPop();

    for (int i = 0; i < popSize; i++) {
      newPop.setSingleChromosome(i, originalPop.getSingleChromosome(i));
    }
    this.crossoverRate = crossoverRate;
    chromosomeLength = originalPop.getSingleChromosome(0).genes.length;
  }