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; }
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; }
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; }
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; }