Package forestry.api.genetics

Examples of forestry.api.genetics.IChromosome


          throw new RuntimeException("Found Chromosome with invalid Alleles. See config option \"genetics.clear.invalid.chromosomes\".");
      }
    }

    // handle old saves that have missing chromosomes
    IChromosome speciesChromosome = chromosomes[EnumTreeChromosome.SPECIES.ordinal()];
    if (speciesChromosome != null) {
      IAlleleSpecies species = (IAlleleSpecies)speciesChromosome.getActiveAllele();
      IAllele[] template = getSpeciesRoot().getTemplate(species.getUID());
      for (int i = 0; i < chromosomes.length; i++) {
        if ((chromosomes[i] == null) && (template[i] != null))
          chromosomes[i] = new Chromosome(template[i]);
      }
View Full Code Here


    IChromosome[] genetics = other.getChromosomes();
    if (chromosomes.length != genetics.length)
      return false;

    for (int i = 0; i < chromosomes.length; i++) {
      IChromosome chromosome = chromosomes[i];
      if (chromosome == null && genetics[i] != null)
        return false;
      if (chromosome != null && genetics[i] == null)
        return false;
      if (chromosome == null && genetics[i] == null)
        continue;

      if (!chromosome.getPrimaryAllele().getUID().equals(genetics[i].getPrimaryAllele().getUID()))
        return false;
      if (!chromosome.getSecondaryAllele().getUID().equals(genetics[i].getSecondaryAllele().getUID()))
        return false;
    }

    return true;
  }
View Full Code Here

TOP

Related Classes of forestry.api.genetics.IChromosome

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.