Changeset 9834 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators
- Timestamp:
- 08/01/13 11:16:16 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs
r9456 r9834 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 { 29 29 [StorableClass] 30 30 [Item("ChangeNodeTypeManipulation", "Selects a random tree node and changes the symbol.")] 31 public sealed class ChangeNodeTypeManipulation : SymbolicExpressionTreeManipulator {31 public sealed class ChangeNodeTypeManipulation : TracingSymbolicExpressionTreeManipulator { 32 32 private const int MAX_TRIES = 100; 33 33 -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs
r9456 r9834 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Parameters; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Parameters;27 27 28 28 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 29 29 [StorableClass] 30 30 [Item("FullTreeShaker", "Manipulates all nodes that have local parameters.")] 31 public sealed class FullTreeShaker : SymbolicExpressionTreeManipulator {31 public sealed class FullTreeShaker : TracingSymbolicExpressionTreeManipulator { 32 32 private const string ShakingFactorParameterName = "ShakingFactor"; 33 33 #region parameter properties -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs
r9456 r9834 37 37 [StorableClass] 38 38 public sealed class MultiSymbolicExpressionTreeManipulator : StochasticMultiBranch<ISymbolicExpressionTreeManipulator>, 39 ITracingSymbolicExpressionTreeOperator, 39 40 ISymbolicExpressionTreeManipulator, 40 41 IStochasticOperator, … … 43 44 private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength"; 44 45 private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth"; 46 private const string SymbolicExpressionTreeNodeComparerParameterName = "SymbolicExpressionTreeNodeComparer"; 47 private const string SymbolicExpressionTreeNodeComparerParameterDescription = "The comparison operator used to check if two symbolic expression tree nodes are equal or similar."; 45 48 49 public ValueParameter<ISymbolicExpressionTreeNodeSimilarityComparer> SymbolicExpressionTreeNodeComparerParameter { 50 get { return (ValueParameter<ISymbolicExpressionTreeNodeSimilarityComparer>)Parameters[SymbolicExpressionTreeNodeComparerParameterName]; } 51 } 46 52 public override bool CanChangeName { 47 53 get { return false; } … … 63 69 #endregion 64 70 71 [StorableHook(HookType.AfterDeserialization)] 72 private void AfterDeserialization() { 73 if (!Parameters.ContainsKey(SymbolicExpressionTreeNodeComparerParameterName)) 74 Parameters.Add(new ValueParameter<ISymbolicExpressionTreeNodeSimilarityComparer>(SymbolicExpressionTreeNodeComparerParameterName, SymbolicExpressionTreeNodeComparerParameterDescription)); 75 } 76 77 65 78 [StorableConstructor] 66 79 private MultiSymbolicExpressionTreeManipulator(bool deserializing) : base(deserializing) { } … … 71 84 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree.")); 72 85 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0).")); 86 Parameters.Add(new ValueParameter<ISymbolicExpressionTreeNodeSimilarityComparer>(SymbolicExpressionTreeNodeComparerParameterName, SymbolicExpressionTreeNodeComparerParameterDescription)); 73 87 74 88 List<ISymbolicExpressionTreeManipulator> list = new List<ISymbolicExpressionTreeManipulator>(); -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs
r9456 r9834 20 20 #endregion 21 21 22 using System. Linq;22 using System.Collections.Generic; 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Parameters; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Parameters;28 using System.Collections.Generic;29 28 30 29 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 31 30 [StorableClass] 32 31 [Item("OnePointShaker", "Selects a random node with local parameters and manipulates the selected node.")] 33 public sealed class OnePointShaker : SymbolicExpressionTreeManipulator {32 public sealed class OnePointShaker : TracingSymbolicExpressionTreeManipulator { 34 33 private const string ShakingFactorParameterName = "ShakingFactor"; 35 34 #region parameter properties -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/RemoveBranchManipulation.cs
r9456 r9834 31 31 [StorableClass] 32 32 [Item("RemoveBranchManipulation", "Removes a random sub-tree of the input tree and fixes the tree by generating random subtrees if necessary..")] 33 public sealed class RemoveBranchManipulation : SymbolicExpressionTreeManipulator, ISymbolicExpressionTreeSizeConstraintOperator {33 public sealed class RemoveBranchManipulation : TracingSymbolicExpressionTreeManipulator, ISymbolicExpressionTreeSizeConstraintOperator { 34 34 private const int MAX_TRIES = 100; 35 35 private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength"; -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs
r9456 r9834 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 { 31 31 [StorableClass] 32 32 [Item("ReplaceBranchManipulation", "Selects a branch of the tree randomly and replaces it with a newly initialized branch (using PTC2).")] 33 public sealed class ReplaceBranchManipulation : SymbolicExpressionTreeManipulator, ISymbolicExpressionTreeSizeConstraintOperator {33 public sealed class ReplaceBranchManipulation : TracingSymbolicExpressionTreeManipulator, ISymbolicExpressionTreeSizeConstraintOperator { 34 34 private const int MAX_TRIES = 100; 35 35 private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength"; -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs
r9456 r9834 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 24 using HeuristicLab.Parameters; 26 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
Note: See TracChangeset
for help on using the changeset viewer.