Changeset 7997 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers
- Timestamp:
- 06/13/12 13:20:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/TracingSymbolicExpressionTreeCrossover.cs
r7817 r7997 25 25 using HeuristicLab.Common; 26 26 using HeuristicLab.Core; 27 using HeuristicLab. Data;27 using HeuristicLab.EvolutionaryTracking; 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 127 127 // compare the two nodes lists and check the difference (comparing node references so we avoid false functional identity). 128 128 // if no difference is found, then it is assumed that the whole tree was swapped with itself (it can happen), so the index is 0 129 int i = 0, min = Math.Min(nodes0.Count, nodes1.Count);130 for ( ; i != min; ++i)129 int i, min = Math.Min(nodes0.Count, nodes1.Count); 130 for (i = 0; i != min; ++i) 131 131 if (nodes0[i] != nodes1[i]) break; 132 132 if (i == min) i = 0; … … 134 134 // add heredity information into the global variables 135 135 GlobalTraceMap[Child] = originalParents; // map child to its corresponding parents from the previous generation 136 GlobalFragmentMap[Child] = new IntValue(i); // map child to the index of its fragment136 GlobalFragmentMap[Child] = new GenericWrapper<ISymbolicExpressionTreeNode>(nodes1[i]); // map child to the index of its fragment 137 137 return base.Apply(); 138 138 }
Note: See TracChangeset
for help on using the changeset viewer.