Changeset 4674 for branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators
- Timestamp:
- 10/29/10 18:55:22 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentCreater.cs
r4524 r4674 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) { -
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDeleter.cs
r4068 r4674 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 -
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs
r4524 r4674 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 -
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
r4068 r4674 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"; … … 46 47 get { return false; } 47 48 } 48 pr otectedoverride bool CreateChildOperation {49 private override bool CreateChildOperation { 49 50 get { return true; } 50 51 } … … 57 58 } 58 59 #endregion 59 60 60 61 61 #region ISymbolicExpressionTreeManipulator Members … … 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() { … … 95 96 } 96 97 97 protected override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeArchitectureManipulator>> e) { 98 public override IDeepCloneable Clone(Cloner cloner) { 99 return new MultiSymbolicExpressionTreeArchitectureManipulator(this, cloner); 100 } 101 102 private override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeArchitectureManipulator>> e) { 98 103 base.Operators_ItemsReplaced(sender, e); 99 104 ParameterizeManipulators(); 100 105 } 101 106 102 pr otectedoverride void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeArchitectureManipulator>> e) {107 private override void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeArchitectureManipulator>> e) { 103 108 base.Operators_ItemsAdded(sender, e); 104 109 ParameterizeManipulators(); -
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineCreater.cs
r4249 r4674 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( -
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs
r4068 r4674 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, -
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDuplicater.cs
r4249 r4674 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, -
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs
r4068 r4674 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.