- Timestamp:
- 07/28/09 19:24:23 (15 years ago)
- Location:
- branches/GP-Refactoring-713
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/GPCrossoverBase.cs
r1286 r2202 36 36 public GPCrossoverBase() 37 37 : base() { 38 AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof( GPOperatorLibrary), VariableKind.In));38 AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(FunctionLibrary), VariableKind.In)); 39 39 AddVariableInfo(new VariableInfo("FunctionTree", "The tree to mutate", typeof(IFunctionTree), VariableKind.In | VariableKind.New)); 40 40 AddVariableInfo(new VariableInfo("TreeSize", "The size (number of nodes) of the tree", typeof(IntData), VariableKind.New)); … … 45 45 46 46 protected override void Cross(IScope scope, IRandom random) { 47 GPOperatorLibrary opLibrary = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);47 FunctionLibrary opLibrary = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true); 48 48 TreeGardener gardener = new TreeGardener(random, opLibrary); 49 49 -
branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/SizeFairCrossOver.cs
r1286 r2202 68 68 69 69 private IFunctionTree GetReplacementBranch(MersenneTwister random, TreeGardener gardener, IFunctionTree intoTree, IFunctionTree parent, int replacedBranchIndex, IFunctionTree fromTree, int maxTreeSize, int maxTreeHeight) { 70 IList<IFunction> allowedFunctions = gardener.GetAllowedSubFunctions(parent.Function, replacedBranchIndex);70 IList<IFunction> allowedFunctions = new List<IFunction>(gardener.GetAllowedSubFunctions(parent.Function, replacedBranchIndex)); 71 71 int removedBranchSize = parent.SubTrees[replacedBranchIndex].Size; 72 72 int maxBranchSize = maxTreeSize - (intoTree.Size - removedBranchSize); -
branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/StandardCrossOver.cs
r1286 r2202 60 60 int maxInsertedBranchHeight = maxTreeHeight - gardener.GetBranchLevel(tree0, parent0); // branchlevel is 1 if tree0==parent0 61 61 62 IList<IFunction> allowedFunctions = gardener.GetAllowedSubFunctions(parent0.Function, replacedChildIndex);62 IList<IFunction> allowedFunctions = new List<IFunction>(gardener.GetAllowedSubFunctions(parent0.Function, replacedChildIndex)); 63 63 allowedCrossoverPoints = GetPossibleCrossoverPoints(gardener, tree1, maxInsertedBranchSize, maxInsertedBranchHeight, allowedFunctions); 64 64 } while (allowedCrossoverPoints.Count == 0 && tries++ < MaxRecombinationTries);
Note: See TracChangeset
for help on using the changeset viewer.