Changeset 12438 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs
- Timestamp:
- 06/12/15 15:35:16 (9 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources
- Property svn:mergeinfo changed
/trunk/sources merged: 12262,12264,12273,12292-12293,12305,12315,12333,12358-12361,12365,12392-12393,12397-12401,12422,12424,12428-12435
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs
r12031 r12438 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Linq; 23 24 using HeuristicLab.Common; … … 26 27 using HeuristicLab.Parameters; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using System.Collections.Generic;29 29 30 30 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 78 78 int tries = 0; 79 79 do { 80 #pragma warning disable 612, 618 80 81 parent = symbolicExpressionTree.Root.IterateNodesPrefix().Skip(1).Where(n => n.SubtreeCount > 0).SelectRandom(random); 82 #pragma warning restore 612, 618 83 81 84 childIndex = random.Next(parent.SubtreeCount); 82 85 var child = parent.GetSubtree(childIndex); … … 99 102 if (tries < MAX_TRIES) { 100 103 var weights = allowedSymbols.Select(s => s.InitialFrequency).ToList(); 104 #pragma warning disable 612, 618 101 105 var seedSymbol = allowedSymbols.SelectRandom(weights, random); 106 #pragma warning restore 612, 618 107 102 108 // replace the old node with the new node 103 109 var seedNode = seedSymbol.CreateTreeNode();
Note: See TracChangeset
for help on using the changeset viewer.