Changeset 17614 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblemInstances.cs
- Timestamp:
- 06/19/20 17:53:36 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblemInstances.cs
r17570 r17614 41 41 [StorableType("4ea0ded8-4451-4011-b88e-4d0680721b01")] 42 42 public sealed class SingleObjectiveBinaryVectorExternalEvaluationProblem : ExternalEvaluationProblem<BinaryVectorEncoding, BinaryVector> { 43 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 44 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 43 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 45 44 46 45 public int Dimension { … … 72 71 [StorableType("46465e8c-11d8-4d02-8c45-de41a08db7fa")] 73 72 public sealed class SingleObjectiveIntegerVectorExternalEvaluationProblem : ExternalEvaluationProblem<IntegerVectorEncoding, IntegerVector> { 74 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 75 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 76 [Storable] private ReferenceParameter<IntMatrix> BoundsRefParameter; 77 public IValueParameter<IntMatrix> BoundsParameter => BoundsRefParameter; 73 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 74 [Storable] private ReferenceParameter<IntMatrix> BoundsRefParameter { get; set; } 78 75 79 76 public int Dimension { … … 112 109 [StorableType("637f091f-6601-494e-bafb-2a8ea474210c")] 113 110 public sealed class SingleObjectiveRealVectorExternalEvaluationProblem : ExternalEvaluationProblem<RealVectorEncoding, RealVector> { 114 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 115 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 116 [Storable] private ReferenceParameter<DoubleMatrix> BoundsRefParameter; 117 public IValueParameter<DoubleMatrix> BoundsParameter => BoundsRefParameter; 111 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 112 [Storable] private ReferenceParameter<DoubleMatrix> BoundsRefParameter { get; set; } 118 113 119 114 public int Dimension { … … 152 147 [StorableType("ad9d45f8-b97e-49a7-b3d2-487d9a2cbdf9")] 153 148 public sealed class SingleObjectivePermutationExternalEvaluationProblem : ExternalEvaluationProblem<PermutationEncoding, Permutation> { 154 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 155 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 149 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 156 150 157 151 public int Dimension { … … 183 177 [StorableType("9b3ee4a8-7076-4edd-ae7e-4188bc49aaa3")] 184 178 public sealed class SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem : ExternalEvaluationProblem<SymbolicExpressionTreeEncoding, ISymbolicExpressionTree> { 179 [Storable] private ReferenceParameter<IntValue> TreeLengthRefParameter { get; set; } 180 [Storable] private ReferenceParameter<IntValue> TreeDepthRefParameter { get; set; } 181 [Storable] private ReferenceParameter<ISymbolicExpressionGrammar> GrammarRefParameter { get; set; } 182 183 public int TreeLength { 184 get => TreeLengthRefParameter.Value.Value; 185 set => TreeLengthRefParameter.Value.Value = value; 186 } 187 188 public int TreeDepth { 189 get => TreeDepthRefParameter.Value.Value; 190 set => TreeDepthRefParameter.Value.Value = value; 191 } 192 193 public ISymbolicExpressionGrammar Grammar { 194 get => GrammarRefParameter.Value; 195 set => GrammarRefParameter.Value = value; 196 } 185 197 186 198 [StorableConstructor] 187 199 private SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { } 188 private SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { } 200 private SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem original, Cloner cloner) 201 : base(original, cloner) { 202 TreeLengthRefParameter = cloner.Clone(original.TreeLengthRefParameter); 203 TreeDepthRefParameter = cloner.Clone(original.TreeDepthRefParameter); 204 GrammarRefParameter = cloner.Clone(original.GrammarRefParameter); 205 } 189 206 190 207 public SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem() 191 208 : base(new SymbolicExpressionTreeEncoding()) { 192 // TODO: Change to ReferenceParameter 193 var lengthParameter = new FixedValueParameter<IntValue>("TreeLength", "The total amount of nodes.", new IntValue(50)); 194 Parameters.Add(lengthParameter); 195 Encoding.TreeLengthParameter = lengthParameter; 196 var depthParameter = new FixedValueParameter<IntValue>("TreeDepth", "The depth of the tree.", new IntValue(10)); 197 Parameters.Add(depthParameter); 198 Encoding.TreeDepthParameter = depthParameter; 209 Parameters.Add(TreeLengthRefParameter = new ReferenceParameter<IntValue>("TreeLength", "The maximum amount of nodes.", Encoding.TreeLengthParameter)); 210 Parameters.Add(TreeDepthRefParameter = new ReferenceParameter<IntValue>("TreeDepth", "The maximum depth of the tree.", Encoding.TreeDepthParameter)); 211 Parameters.Add(GrammarRefParameter = new ReferenceParameter<ISymbolicExpressionGrammar>("Grammar", "The grammar that describes a valid tree.", Encoding.GrammarParameter)); 199 212 // TODO: Add and parameterize additional operators, 200 213 } … … 210 223 [StorableType("945a35d9-89a8-4423-9ea0-21829ac68887")] 211 224 public sealed class SingleObjectiveLinearLinkageExternalEvaluationProblem : ExternalEvaluationProblem<LinearLinkageEncoding, LinearLinkage> { 212 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 213 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 225 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 214 226 215 227 public int Dimension { … … 258 270 [StorableType("f14c7e88-b74d-4cad-ae55-83daf7b4c288")] 259 271 public sealed class MultiObjectiveBinaryVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<BinaryVectorEncoding, BinaryVector> { 260 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 261 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 272 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 262 273 263 274 public int Dimension { … … 289 300 [StorableType("90a82c2f-6c37-4ffd-8495-bee278c583d3")] 290 301 public sealed class MultiObjectiveIntegerVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<IntegerVectorEncoding, IntegerVector> { 291 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 292 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 293 [Storable] private ReferenceParameter<IntMatrix> BoundsRefParameter; 294 public IValueParameter<IntMatrix> BoundsParameter => BoundsRefParameter; 302 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 303 [Storable] private ReferenceParameter<IntMatrix> BoundsRefParameter { get; set; } 295 304 296 305 public int Dimension { … … 329 338 [StorableType("38e1d068-d569-48c5-bad6-cbdd685b7c6b")] 330 339 public sealed class MultiObjectiveRealVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<RealVectorEncoding, RealVector> { 331 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 332 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 333 [Storable] private ReferenceParameter<DoubleMatrix> BoundsRefParameter; 334 public IValueParameter<DoubleMatrix> BoundsParameter => BoundsRefParameter; 340 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 341 [Storable] private ReferenceParameter<DoubleMatrix> BoundsRefParameter { get; set; } 335 342 336 343 public int Dimension { … … 369 376 [StorableType("f1b265b0-ac7c-4c36-b346-5b3f2c37694b")] 370 377 public sealed class MultiObjectivePermutationExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<PermutationEncoding, Permutation> { 371 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 372 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 378 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 373 379 374 380 public int Dimension { … … 400 406 [StorableType("fb6834e2-2d56-4711-a3f8-5e0ab55cd040")] 401 407 public sealed class MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<SymbolicExpressionTreeEncoding, ISymbolicExpressionTree> { 408 [Storable] private ReferenceParameter<IntValue> TreeLengthRefParameter { get; set; } 409 [Storable] private ReferenceParameter<IntValue> TreeDepthRefParameter { get; set; } 410 [Storable] private ReferenceParameter<ISymbolicExpressionGrammar> GrammarRefParameter { get; set; } 411 412 public int TreeLength { 413 get => TreeLengthRefParameter.Value.Value; 414 set => TreeLengthRefParameter.Value.Value = value; 415 } 416 417 public int TreeDepth { 418 get => TreeDepthRefParameter.Value.Value; 419 set => TreeDepthRefParameter.Value.Value = value; 420 } 421 422 public ISymbolicExpressionGrammar Grammar { 423 get => GrammarRefParameter.Value; 424 set => GrammarRefParameter.Value = value; 425 } 402 426 403 427 [StorableConstructor] 404 428 private MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { } 405 private MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { } 429 private MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem original, Cloner cloner) 430 : base(original, cloner) { 431 TreeLengthRefParameter = cloner.Clone(original.TreeLengthRefParameter); 432 TreeDepthRefParameter = cloner.Clone(original.TreeDepthRefParameter); 433 GrammarRefParameter = cloner.Clone(original.GrammarRefParameter); 434 } 406 435 407 436 public MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem() 408 437 : base(new SymbolicExpressionTreeEncoding()) { 409 // TODO: Change to ReferenceParameter 410 var lengthParameter = new FixedValueParameter<IntValue>("TreeLength", "The total amount of nodes.", new IntValue(50)); 411 Parameters.Add(lengthParameter); 412 Encoding.TreeLengthParameter = lengthParameter; 413 var depthParameter = new FixedValueParameter<IntValue>("TreeDepth", "The depth of the tree.", new IntValue(10)); 414 Parameters.Add(depthParameter); 415 Encoding.TreeDepthParameter = depthParameter; 438 Parameters.Add(TreeLengthRefParameter = new ReferenceParameter<IntValue>("TreeLength", "The maximum amount of nodes.", Encoding.TreeLengthParameter)); 439 Parameters.Add(TreeDepthRefParameter = new ReferenceParameter<IntValue>("TreeDepth", "The maximum depth of the tree.", Encoding.TreeDepthParameter)); 440 Parameters.Add(GrammarRefParameter = new ReferenceParameter<ISymbolicExpressionGrammar>("Grammar", "The grammar that describes a valid tree.", Encoding.GrammarParameter)); 416 441 // TODO: Add and parameterize additional operators, 417 442 } … … 427 452 [StorableType("ed0c1129-651d-465f-87b0-f412f3e3b3d1")] 428 453 public sealed class MultiObjectiveLinearLinkageExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<LinearLinkageEncoding, LinearLinkage> { 429 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter; 430 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter; 454 [Storable] private ReferenceParameter<IntValue> DimensionRefParameter { get; set; } 431 455 432 456 public int Dimension {
Note: See TracChangeset
for help on using the changeset viewer.