Ejemplo n.º 1
0
 public ATForest eliteCopy(int generationOfOrigin) {
   ATForest forest = new ATForest(generationOfOrigin, this.getNumOfInputs(), id);
   forest.trees = new ATTree[trees.length];
   for (int i = 0; i < trees.length; i++) {
     ATTree eliteCopy = this.trees[i].copy();
     eliteCopy.elite();
     forest.trees[i] = eliteCopy;
   }
   forest.initEvaluationInfo();
   return forest;
 }
Ejemplo n.º 2
0
  public ATForest mutateHeavyStructure(int generationOfOrigin) {
    ATForest forest = new ATForest(generationOfOrigin, this.getNumOfInputs(), id);
    forest.trees = new ATTree[trees.length];
    for (int i = 0; i < trees.length; i++) {
      ATTree toMutate = this.trees[i].copy();

      for (int j = 0; j < GPAT.MUTATION_HEAVY_POWER; j++) {
        toMutate.mutateStructure();
      }

      forest.trees[i] = toMutate;
    }
    forest.initEvaluationInfo();
    return forest;
  }
Ejemplo n.º 3
0
  public ATForest mutate(int generationOfOrigin) {
    ATForest forest = new ATForest(generationOfOrigin, this.getNumOfInputs(), id);
    forest.trees = new ATTree[trees.length];
    for (int i = 0; i < trees.length; i++) {
      ATTree toMutate = this.trees[i].copy();

      toMutate.mutateStructure();
      toMutate.mutateConstants();
      toMutate.mutateSwitchLocks();

      forest.trees[i] = toMutate;
    }
    forest.initEvaluationInfo();
    return forest;
  }
Ejemplo n.º 4
0
 public static ATForest createRandom(
     int generationOfOrigin,
     int numOfInputs,
     int numOfOutputs,
     ATNodeCollection nodeCollection,
     ATInnovationHistory innovationHistory) {
   ATForest forest = new ATForest(generationOfOrigin, numOfInputs);
   forest.trees = new ATTree[numOfOutputs];
   for (int i = 0; i < numOfOutputs; i++) {
     forest.trees[i] = ATTree.createMinimalSubstrate(nodeCollection, innovationHistory);
     //            forest.trees[i] = ATTree.createMinimalSubstrateWithInputs(nodeCollection,
     // innovationHistory);
   }
   forest.initEvaluationInfo();
   return forest;
 }