Changeset 15281 for branches/Async/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers
- Timestamp:
- 07/23/17 11:17:18 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Async/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs
r12509 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 95 95 int childLength = crossoverPoint0.Child != null ? crossoverPoint0.Child.GetLength() : 0; 96 96 // calculate the max length and depth that the inserted branch can have 97 int maxInsertedBranchLength = maxTreeLength - (parent0.Length - childLength);98 int maxInsertedBranchDepth = maxTreeDepth - parent0.Root.GetBranchLevel(crossoverPoint0.Parent);97 int maxInsertedBranchLength = Math.Max(0, maxTreeLength - (parent0.Length - childLength)); 98 int maxInsertedBranchDepth = Math.Max(0, maxTreeDepth - parent0.Root.GetBranchLevel(crossoverPoint0.Parent)); 99 99 100 100 List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>(); … … 111 111 } else { 112 112 var selectedBranch = SelectRandomBranch(random, allowedBranches, internalCrossoverPointProbability); 113 if (selectedBranch != null) 114 selectedBranch = (ISymbolicExpressionTreeNode)selectedBranch.Clone(); 113 115 114 116 if (crossoverPoint0.Child != null) { -
branches/Async/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs
r12480 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.