- Timestamp:
- 05/15/14 15:06:57 (11 years ago)
- Location:
- branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/BinaryParameterConfiguration.cs
r10850 r10856 46 46 length = cloner.Clone(original.length); 47 47 } 48 public BinaryParameterConfiguration(int length) 49 : base() { 48 public BinaryParameterConfiguration(int length) { 50 49 this.length = new IntValue(length); 51 50 } -
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/Configuration.cs
r10855 r10856 34 34 public Dictionary<string, ParameterConfiguration> Parameters { get; protected set; } 35 35 36 [Storable]37 public bool Maximization { get; protected set; }38 39 36 [StorableConstructor] 40 37 protected Configuration(bool deserializing) : base(deserializing) { } … … 47 44 } 48 45 } 49 Maximization = original.Maximization;50 46 } 51 47 public Configuration() { … … 88 84 } 89 85 90 public Configuration AddPermutation(string name, PermutationTypes type, int length) {86 public Configuration AddPermutation(string name, int length, PermutationTypes type) { 91 87 if (Parameters.ContainsKey(name)) throw new ArgumentException("name must be unique", "name"); 92 88 Parameters.Add(name, new PermutationParameterConfiguration(length, type)); 93 89 return this; 94 90 } 95 96 public Configuration SetMaximization(bool maximization) {97 Maximization = maximization;98 return this;99 }100 91 } 101 92 } -
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/IntegerParameterConfiguration.cs
r10850 r10856 61 61 bounds = cloner.Clone(original.bounds); 62 62 } 63 public IntegerParameterConfiguration(int length, int min, int max, int? step = null) 64 : base() { 63 public IntegerParameterConfiguration(int length, int min, int max, int? step = null) { 65 64 if (min >= max) throw new ArgumentException("min must be less than max", "min"); 66 65 if (step.HasValue && step.Value <= 0) throw new ArgumentException("step must be greater than zero or null", "step"); … … 71 70 if (step.HasValue) bounds[0, 2] = step.Value; 72 71 } 73 public IntegerParameterConfiguration(int length, IList<int> min, IList<int> max, IList<int> step = null) 74 : base() { 72 public IntegerParameterConfiguration(int length, IList<int> min, IList<int> max, IList<int> step = null) { 75 73 if (min.Count == 0) throw new ArgumentException("Bounds must be given for the integer parameters."); 76 74 if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min"); 77 75 if (step != null && min.Count != step.Count) throw new ArgumentException("step must be of the same length as min or null", "step"); 78 if (min.Zip(max, (m , M) => m >= M).Any()) throw new ArgumentException("min must be less than max in each dimension", "min");76 if (min.Zip(max, (mi, ma) => mi >= ma).Any()) throw new ArgumentException("min must be less than max in each dimension", "min"); 79 77 this.length = new IntValue(length); 80 78 bounds = new IntMatrix(min.Count, step != null ? 3 : 2); -
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/PermutationParameterConfiguration.cs
r10850 r10856 59 59 type = cloner.Clone(original.type); 60 60 } 61 public PermutationParameterConfiguration(int length, PermutationTypes type) 62 : base() { 61 public PermutationParameterConfiguration(int length, PermutationTypes type) { 63 62 this.length = new IntValue(length); 64 63 this.type = new PermutationType(type); -
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/RealParameterConfiguration.cs
r10850 r10856 61 61 bounds = cloner.Clone(original.bounds); 62 62 } 63 public RealParameterConfiguration(int length, double min, double max) 64 : base() { 63 public RealParameterConfiguration(int length, double min, double max) { 65 64 if (min >= max) throw new ArgumentException("min must be less than max", "min"); 66 65 this.length = new IntValue(length); … … 69 68 bounds[0, 1] = max; 70 69 } 71 public RealParameterConfiguration(int length, IList<double> min, IList<double> max) 72 : base() { 70 public RealParameterConfiguration(int length, IList<double> min, IList<double> max) { 73 71 if (min.Count == 0) throw new ArgumentException("Bounds must be given for the real parameters."); 74 72 if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min"); 75 if (min.Zip(max, (m , M) => m >= M).Any()) throw new ArgumentException("min must be less than max in each dimension", "min");73 if (min.Zip(max, (mi, ma) => mi >= ma).Any()) throw new ArgumentException("min must be less than max in each dimension", "min"); 76 74 this.length = new IntValue(length); 77 75 bounds = new DoubleMatrix(min.Count, 2);
Note: See TracChangeset
for help on using the changeset viewer.