- Timestamp:
- 02/04/15 13:28:37 (10 years ago)
- Location:
- branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings
- Files:
-
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryVectorEncoding.cs
r11879 r11885 32 32 33 33 namespace HeuristicLab.Problems.Programmable { 34 [Item("Binary Encoding", "Describes a binary vector encoding.")]34 [Item("BinaryVectorEncoding", "Describes a binary vector encoding.")] 35 35 [StorableClass] 36 public sealed class Binary Encoding : Encoding<IBinaryVectorCreator> {36 public sealed class BinaryVectorEncoding : Encoding<IBinaryVectorCreator> { 37 37 #region Encoding Parameters 38 38 [Storable] … … 59 59 60 60 [StorableConstructor] 61 private Binary Encoding(bool deserializing) : base(deserializing) { }61 private BinaryVectorEncoding(bool deserializing) : base(deserializing) { } 62 62 [StorableHook(HookType.AfterDeserialization)] 63 63 private void AfterDeserialization() { … … 65 65 DiscoverOperators(); 66 66 } 67 public override IDeepCloneable Clone(Cloner cloner) { return new Binary Encoding(this, cloner); }68 private Binary Encoding(BinaryEncoding original, Cloner cloner)67 public override IDeepCloneable Clone(Cloner cloner) { return new BinaryVectorEncoding(this, cloner); } 68 private BinaryVectorEncoding(BinaryVectorEncoding original, Cloner cloner) 69 69 : base(original, cloner) { 70 70 lengthParameter = cloner.Clone(original.lengthParameter); … … 72 72 } 73 73 74 public Binary Encoding() : this("BinaryVector", 10) { }75 public Binary Encoding(int length) : this("BinaryVector", length) { }76 public Binary Encoding(string name, int length)74 public BinaryVectorEncoding() : this("BinaryVector", 10) { } 75 public BinaryVectorEncoding(int length) : this("BinaryVector", length) { } 76 public BinaryVectorEncoding(string name, int length) 77 77 : base(name) { 78 78 lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length)); … … 98 98 #region Operator Discovery 99 99 private static readonly IEnumerable<Type> encodingSpecificOperatorTypes; 100 static Binary Encoding() {100 static BinaryVectorEncoding() { 101 101 encodingSpecificOperatorTypes = new List<Type>() { 102 102 typeof (IBinaryVectorOperator), -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerVectorEncoding.cs
r11879 r11885 33 33 34 34 namespace HeuristicLab.Problems.Programmable { 35 [Item("Integer Encoding", "Describes an integer vector encoding.")]35 [Item("IntegerVectorEncoding", "Describes an integer vector encoding.")] 36 36 [StorableClass] 37 public sealed class Integer Encoding : Encoding<IIntegerVectorCreator> {37 public sealed class IntegerVectorEncoding : Encoding<IIntegerVectorCreator> { 38 38 #region Encoding Parameters 39 39 [Storable] … … 79 79 80 80 [StorableConstructor] 81 private Integer Encoding(bool deserializing) : base(deserializing) { }81 private IntegerVectorEncoding(bool deserializing) : base(deserializing) { } 82 82 [StorableHook(HookType.AfterDeserialization)] 83 83 private void AfterDeserialization() { … … 86 86 } 87 87 88 private Integer Encoding(IntegerEncoding original, Cloner cloner)88 private IntegerVectorEncoding(IntegerVectorEncoding original, Cloner cloner) 89 89 : base(original, cloner) { 90 90 lengthParameter = cloner.Clone(original.lengthParameter); … … 92 92 RegisterParameterEvents(); 93 93 } 94 public override IDeepCloneable Clone(Cloner cloner) { return new Integer Encoding(this, cloner); }95 96 97 public Integer Encoding() : this("IntegerVector", 10) { }98 public Integer Encoding(int length) : this("integerVector", length) { }99 public Integer Encoding(string name, int length, int min = int.MinValue, int max = int.MaxValue, int? step = null)94 public override IDeepCloneable Clone(Cloner cloner) { return new IntegerVectorEncoding(this, cloner); } 95 96 97 public IntegerVectorEncoding() : this("IntegerVector", 10) { } 98 public IntegerVectorEncoding(int length) : this("integerVector", length) { } 99 public IntegerVectorEncoding(string name, int length, int min = int.MinValue, int max = int.MaxValue, int? step = null) 100 100 : base(name) { 101 101 if (min >= max) throw new ArgumentException("min must be less than max", "min"); … … 116 116 DiscoverOperators(); 117 117 } 118 public Integer Encoding(string name, int length, IList<int> min, IList<int> max, IList<int> step = null)118 public IntegerVectorEncoding(string name, int length, IList<int> min, IList<int> max, IList<int> step = null) 119 119 : base(name) { 120 120 if (min.Count == 0) throw new ArgumentException("Bounds must be given for the integer parameters."); … … 163 163 #region Operator Discovery 164 164 private static readonly IEnumerable<Type> encodingSpecificOperatorTypes; 165 static Integer Encoding() {165 static IntegerVectorEncoding() { 166 166 encodingSpecificOperatorTypes = new List<Type>() { 167 167 typeof (IIntegerVectorOperator), -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealVectorEncoding.cs
r11879 r11885 33 33 34 34 namespace HeuristicLab.Problems.Programmable { 35 [Item("Real Encoding", "Describes a real vector encoding.")]35 [Item("RealVectorEncoding", "Describes a real vector encoding.")] 36 36 [StorableClass] 37 public sealed class Real Encoding : Encoding<IRealVectorCreator> {37 public sealed class RealVectorEncoding : Encoding<IRealVectorCreator> { 38 38 #region Encoding Parameters 39 39 [Storable] … … 78 78 79 79 [StorableConstructor] 80 private Real Encoding(bool deserializing) : base(deserializing) { }80 private RealVectorEncoding(bool deserializing) : base(deserializing) { } 81 81 [StorableHook(HookType.AfterDeserialization)] 82 82 private void AfterDeserialization() { … … 85 85 } 86 86 87 public override IDeepCloneable Clone(Cloner cloner) { return new Real Encoding(this, cloner); }88 private Real Encoding(RealEncoding original, Cloner cloner)87 public override IDeepCloneable Clone(Cloner cloner) { return new RealVectorEncoding(this, cloner); } 88 private RealVectorEncoding(RealVectorEncoding original, Cloner cloner) 89 89 : base(original, cloner) { 90 90 lengthParameter = cloner.Clone(original.lengthParameter); … … 93 93 } 94 94 95 public Real Encoding() : this("RealVector", 10) { }96 public Real Encoding(int length) : this("RealVector", length) { }97 public Real Encoding(string name, int length, double min = double.MinValue, double max = double.MaxValue)95 public RealVectorEncoding() : this("RealVector", 10) { } 96 public RealVectorEncoding(int length) : this("RealVector", length) { } 97 public RealVectorEncoding(string name, int length, double min = double.MinValue, double max = double.MaxValue) 98 98 : base(name) { 99 99 if (min >= max) throw new ArgumentException("min must be less than max", "min"); … … 113 113 } 114 114 115 public Real Encoding(string name, int length, IList<double> min, IList<double> max)115 public RealVectorEncoding(string name, int length, IList<double> min, IList<double> max) 116 116 : base(name) { 117 117 if (min.Count == 0) throw new ArgumentException("Bounds must be given for the real parameters."); … … 156 156 #region Operator Discovery 157 157 private static readonly IEnumerable<Type> encodingSpecificOperatorTypes; 158 static Real Encoding() {158 static RealVectorEncoding() { 159 159 encodingSpecificOperatorTypes = new List<Type>() { 160 160 typeof (IRealVectorOperator),
Note: See TracChangeset
for help on using the changeset viewer.