Changeset 4722 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators
- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentCreater.cs
r4524 r4722 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; 25 using HeuristicLab.Common; 24 26 using HeuristicLab.Core; 25 27 using HeuristicLab.Data; 26 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; 27 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using System;29 30 30 31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators { … … 36 37 [StorableClass] 37 38 public sealed class ArgumentCreater : SymbolicExpressionTreeArchitectureManipulator { 39 [StorableConstructor] 40 private ArgumentCreater(bool deserializing) : base(deserializing) { } 41 private ArgumentCreater(ArgumentCreater original, Cloner cloner) : base(original, cloner) { } 42 public ArgumentCreater() : base() { } 38 43 public override sealed void ModifyArchitecture( 39 44 IRandom random, … … 44 49 out bool success) { 45 50 success = CreateNewArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value); 51 } 52 53 public override IDeepCloneable Clone(Cloner cloner) { 54 return new ArgumentCreater(this, cloner); 46 55 } 47 56 … … 91 100 } 92 101 } 93 94 102 95 103 private static bool CreateNewArgumentForDefun(IRandom random, SymbolicExpressionTree tree, DefunTreeNode defunBranch, ArgumentTreeNode newArgumentNode) { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDeleter.cs
r4068 r4722 21 21 22 22 using System.Linq; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 33 34 [StorableClass] 34 35 public sealed class ArgumentDeleter : SymbolicExpressionTreeArchitectureManipulator { 36 [StorableConstructor] 37 private ArgumentDeleter(bool deserializing) : base(deserializing) { } 38 private ArgumentDeleter(ArgumentDeleter original, Cloner cloner) : base(original, cloner) { } 39 public ArgumentDeleter() : base() { } 40 35 41 public override sealed void ModifyArchitecture( 36 42 IRandom random, … … 41 47 out bool success) { 42 48 success = DeleteArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value); 49 } 50 51 public override IDeepCloneable Clone(Cloner cloner) { 52 return new ArgumentDeleter(this, cloner); 43 53 } 44 54 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs
r4524 r4722 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 22 24 using System.Linq; 25 using HeuristicLab.Common; 23 26 using HeuristicLab.Core; 24 27 using HeuristicLab.Data; 25 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; 26 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Collections.Generic;28 using System;29 30 30 31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators { … … 36 37 [StorableClass] 37 38 public sealed class ArgumentDuplicater : SymbolicExpressionTreeArchitectureManipulator { 39 [StorableConstructor] 40 private ArgumentDuplicater(bool deserializing) : base(deserializing) { } 41 private ArgumentDuplicater(ArgumentDuplicater original, Cloner cloner) : base(original, cloner) { } 42 public ArgumentDuplicater() : base() { } 43 38 44 public override sealed void ModifyArchitecture( 39 45 IRandom random, … … 44 50 out bool success) { 45 51 success = DuplicateArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value); 52 } 53 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new ArgumentDuplicater(this, cloner); 46 56 } 47 57 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
r4068 r4722 23 23 using System.Linq; 24 24 using HeuristicLab.Collections; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 27 using HeuristicLab.Data; … … 35 36 [Item("MultiSymbolicExpressionTreeArchitectureManipulator", "Randomly selects and applies one of its architecture manipulators every time it is called.")] 36 37 [StorableClass] 37 public class MultiSymbolicExpressionTreeArchitectureManipulator : StochasticMultiBranch<ISymbolicExpressionTreeArchitectureManipulator>, ISymbolicExpressionTreeArchitectureManipulator, IStochasticOperator {38 public sealed class MultiSymbolicExpressionTreeArchitectureManipulator : StochasticMultiBranch<ISymbolicExpressionTreeArchitectureManipulator>, ISymbolicExpressionTreeArchitectureManipulator, IStochasticOperator { 38 39 private const string MaxTreeSizeParameterName = "MaxTreeSize"; 39 40 private const string MaxTreeHeightParameterName = "MaxTreeHeight"; … … 58 59 #endregion 59 60 60 61 61 #region ISymbolicExpressionTreeManipulator Members 62 62 public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { … … 80 80 [StorableConstructor] 81 81 private MultiSymbolicExpressionTreeArchitectureManipulator(bool deserializing) : base(deserializing) { } 82 private MultiSymbolicExpressionTreeArchitectureManipulator(MultiSymbolicExpressionTreeArchitectureManipulator original, Cloner cloner) : base(original, cloner) { } 82 83 public MultiSymbolicExpressionTreeArchitectureManipulator() 83 84 : base() { … … 93 94 Operators.Add((ISymbolicExpressionTreeArchitectureManipulator)Activator.CreateInstance(type), true); 94 95 } 96 } 97 98 public override IDeepCloneable Clone(Cloner cloner) { 99 return new MultiSymbolicExpressionTreeArchitectureManipulator(this, cloner); 95 100 } 96 101 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineCreater.cs
r4249 r4722 24 24 using System.Linq; 25 25 using System.Text; 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Data; … … 39 40 public sealed class SubroutineCreater : SymbolicExpressionTreeArchitectureManipulator { 40 41 private const double ARGUMENT_CUTOFF_PROBABILITY = 0.05; 42 43 [StorableConstructor] 44 private SubroutineCreater(bool deserializing) : base(deserializing) { } 45 private SubroutineCreater(SubroutineCreater original, Cloner cloner) : base(original, cloner) { } 46 public SubroutineCreater() : base() { } 47 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new SubroutineCreater(this, cloner); 50 } 41 51 42 52 public override sealed void ModifyArchitecture( -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs
r4068 r4722 22 22 using System; 23 23 using System.Linq; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 36 37 [StorableClass] 37 38 public sealed class SubroutineDeleter : SymbolicExpressionTreeArchitectureManipulator { 39 [StorableConstructor] 40 private SubroutineDeleter(bool deserializing) : base(deserializing) { } 41 private SubroutineDeleter(SubroutineDeleter original, Cloner cloner) : base(original, cloner) { } 42 public SubroutineDeleter() : base() { } 43 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new SubroutineDeleter(this, cloner); 46 } 47 38 48 public override sealed void ModifyArchitecture( 39 49 IRandom random, -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDuplicater.cs
r4249 r4722 24 24 using System.Linq; 25 25 using System.Text; 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Data; … … 37 38 [StorableClass] 38 39 public sealed class SubroutineDuplicater : SymbolicExpressionTreeArchitectureManipulator { 40 [StorableConstructor] 41 private SubroutineDuplicater(bool deserializing) : base(deserializing) { } 42 private SubroutineDuplicater(SubroutineDuplicater original, Cloner cloner) 43 : base(original, cloner) { 44 } 45 public SubroutineDuplicater() : base() { } 46 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new SubroutineDuplicater(this, cloner); 49 } 50 39 51 public override sealed void ModifyArchitecture( 40 52 IRandom random, -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 51 52 get { return MaxFunctionArgumentsParameter.ActualValue; } 52 53 } 54 [StorableConstructor] 55 protected SymbolicExpressionTreeArchitectureManipulator(bool deserializing) : base(deserializing) { } 56 protected SymbolicExpressionTreeArchitectureManipulator(SymbolicExpressionTreeArchitectureManipulator original, Cloner cloner) : base(original, cloner) { } 53 57 public SymbolicExpressionTreeArchitectureManipulator() 54 58 : base() {
Note: See TracChangeset
for help on using the changeset viewer.