Changeset 10856 for branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveScript.cs
- Timestamp:
- 05/15/14 15:06:57 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveScript.cs
r10850 r10856 40 40 } 41 41 42 public new SingleObjectiveProblemBaseInstance {43 get { return ( SingleObjectiveProblemBase)base.Instance; }42 public new ISingleObjectiveProblemDefinition Instance { 43 get { return (ISingleObjectiveProblemDefinition)base.Instance; } 44 44 protected set { base.Instance = value; } 45 45 } … … 56 56 using HeuristicLab.Problems.Programmable; 57 57 58 public class MyProblem : HeuristicLab.Problems.Programmable.SingleObjectiveProblemBase{59 public MyProblem() {58 public class ProblemDefinition : ISingleObjectiveProblemDefinition { 59 public ProblemDefinition() { 60 60 // initialize private fields 61 61 } 62 62 63 public override Configuration GetConfiguration() { 63 public bool IsMaximizationProblem { get { return false; } } 64 65 public Configuration GetConfiguration() { 64 66 return new Configuration() 65 // .SetMaximization(true) 66 // add an arbitrary number of uniquely named parameter vectors 67 // .AddBinary(""p"", length: 5) 67 // .AddBinary(""b"", length: 5) 68 68 // .AddInteger(""i"", length: 5, min: 2, max: 14, step: 4) 69 69 // .AddReal(""r"", length: 5, min: -1.0, max: 1.0) 70 // .AddPermutation(""P"", type: PermutationTypes.Absolute, length: 5)70 // .AddPermutation(""P"", length: 5, type: PermutationTypes.Absolute) 71 71 ; 72 72 } 73 73 74 public overridedouble Evaluate(IRandom random, ParameterVector vector) {74 public double Evaluate(IRandom random, ParameterVector vector) { 75 75 var quality = 0.0; 76 76 // quality = vector.Real(""r"").Select(x => x * x).Sum();
Note: See TracChangeset
for help on using the changeset viewer.