Changeset 5411 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs
- Timestamp:
- 02/03/11 13:47:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs
r4722 r5411 28 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using System.Collections.Generic; 30 31 31 32 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators { … … 97 98 // deletion by random regeneration 98 99 SymbolicExpressionTreeNode replacementTree = null; 99 // TODO: should weight symbols by tickets 100 var selectedSymbol = invocationCutPoint.Parent.GetAllowedSymbols(invocationCutPoint.ReplacedChildIndex).SelectRandom(random); 100 var allowedSymbolsList = invocationCutPoint.Parent.GetAllowedSymbols(invocationCutPoint.ReplacedChildIndex).ToList(); 101 var weights = allowedSymbolsList.Select(s => s.InitialFrequency); 102 var selectedSymbol = allowedSymbolsList.SelectRandom(weights, random); 101 103 102 104 int minPossibleSize = invocationCutPoint.Parent.Grammar.GetMinExpressionLength(selectedSymbol);
Note: See TracChangeset
for help on using the changeset viewer.