Changeset 12891 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs
- Timestamp:
- 08/22/15 14:27:37 (9 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs
r12155 r12891 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using System.Collections.Generic;27 27 28 28 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 53 53 int tries = 0; 54 54 do { 55 56 #pragma warning disable 612, 618 55 57 parent = symbolicExpressionTree.Root.IterateNodesPrefix().Skip(1).Where(n => n.SubtreeCount > 0).SelectRandom(random); 58 #pragma warning restore 612, 618 59 56 60 childIndex = random.Next(parent.SubtreeCount); 57 61 … … 81 85 if (tries < MAX_TRIES) { 82 86 var weights = allowedSymbols.Select(s => s.InitialFrequency).ToList(); 87 #pragma warning disable 612, 618 83 88 var newSymbol = allowedSymbols.SelectRandom(weights, random); 89 #pragma warning restore 612, 618 84 90 85 91 // replace the old node with the new node
Note: See TracChangeset
for help on using the changeset viewer.