Package jcgp.backend.population

Examples of jcgp.backend.population.Mutable


    if (report.get()) getResources().reportln("[Mutator] Number of mutations to be performed: " + genesMutated.get());
   
    // for however many genes must be mutated
    for (int i = 0; i < genesMutated.get(); i++) {
      // choose a random mutable
      Mutable mutable = chromosome.getRandomMutable();
     
      if (report.get()) getResources().reportln("[Mutator] Mutation " + i + " selected " + mutable);
     
      // mutate a random gene
      mutable.mutate();
    }
  }
View Full Code Here


  public void randomMutableTest() {
    // get mutable elements, check Node to Output ratio
    int mutablePicks = 100000;
    int mutableNodes = 0, mutableOutputs = 0;
    for (int i = 0; i < mutablePicks; i++) {
      Mutable m = chromosome.getRandomMutable();

      if (m instanceof Node) {
        mutableNodes++;
      } else if (m instanceof Output) {
        mutableOutputs++;
View Full Code Here

TOP

Related Classes of jcgp.backend.population.Mutable

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.