Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/13 11:16:16 (11 years ago)
Author:
bburlacu
Message:

#1772: Manually merged HeuristicLab.Encodings.SymbolicExpressionTreeEncoding project from the trunk to the branch.

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  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using System.Linq;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using System.Collections.Generic;
    2727
    2828namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2929  [StorableClass]
    3030  [Item("ChangeNodeTypeManipulation", "Selects a random tree node and changes the symbol.")]
    31   public sealed class ChangeNodeTypeManipulation : SymbolicExpressionTreeManipulator {
     31  public sealed class ChangeNodeTypeManipulation : TracingSymbolicExpressionTreeManipulator {
    3232    private const int MAX_TRIES = 100;
    3333
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs

    r9456 r9834  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Data;
     25using HeuristicLab.Parameters;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Parameters;
    2727
    2828namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2929  [StorableClass]
    3030  [Item("FullTreeShaker", "Manipulates all nodes that have local parameters.")]
    31   public sealed class FullTreeShaker : SymbolicExpressionTreeManipulator {
     31  public sealed class FullTreeShaker : TracingSymbolicExpressionTreeManipulator {
    3232    private const string ShakingFactorParameterName = "ShakingFactor";
    3333    #region parameter properties
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs

    r9456 r9834  
    3737  [StorableClass]
    3838  public sealed class MultiSymbolicExpressionTreeManipulator : StochasticMultiBranch<ISymbolicExpressionTreeManipulator>,
     39    ITracingSymbolicExpressionTreeOperator,
    3940    ISymbolicExpressionTreeManipulator,
    4041    IStochasticOperator,
     
    4344    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
    4445    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.";
    4548
     49    public ValueParameter<ISymbolicExpressionTreeNodeSimilarityComparer> SymbolicExpressionTreeNodeComparerParameter {
     50      get { return (ValueParameter<ISymbolicExpressionTreeNodeSimilarityComparer>)Parameters[SymbolicExpressionTreeNodeComparerParameterName]; }
     51    }
    4652    public override bool CanChangeName {
    4753      get { return false; }
     
    6369    #endregion
    6470
     71    [StorableHook(HookType.AfterDeserialization)]
     72    private void AfterDeserialization() {
     73      if (!Parameters.ContainsKey(SymbolicExpressionTreeNodeComparerParameterName))
     74        Parameters.Add(new ValueParameter<ISymbolicExpressionTreeNodeSimilarityComparer>(SymbolicExpressionTreeNodeComparerParameterName, SymbolicExpressionTreeNodeComparerParameterDescription));
     75    }
     76
     77
    6578    [StorableConstructor]
    6679    private MultiSymbolicExpressionTreeManipulator(bool deserializing) : base(deserializing) { }
     
    7184      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
    7285      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));
    7387
    7488      List<ISymbolicExpressionTreeManipulator> list = new List<ISymbolicExpressionTreeManipulator>();
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs

    r9456 r9834  
    2020#endregion
    2121
    22 using System.Linq;
     22using System.Collections.Generic;
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Data;
     26using HeuristicLab.Parameters;
    2627using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.Parameters;
    28 using System.Collections.Generic;
    2928
    3029namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    3130  [StorableClass]
    3231  [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 {
    3433    private const string ShakingFactorParameterName = "ShakingFactor";
    3534    #region parameter properties
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/RemoveBranchManipulation.cs

    r9456 r9834  
    3131  [StorableClass]
    3232  [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 {
    3434    private const int MAX_TRIES = 100;
    3535    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs

    r9456 r9834  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using System.Linq;
    2324using HeuristicLab.Common;
     
    2627using HeuristicLab.Parameters;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using System.Collections.Generic;
    2929
    3030namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    3131  [StorableClass]
    3232  [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 {
    3434    private const int MAX_TRIES = 100;
    3535    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs

    r9456 r9834  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2524using HeuristicLab.Parameters;
    2625using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
Note: See TracChangeset for help on using the changeset viewer.