Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/31/10 16:26:37 (14 years ago)
Author:
abeham
Message:

#1023

  • Added EmptyUserDefinedProblemEvaluator and set as default evaluator in UserDefinedProblem
  • Reverted accidental change to ES
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization/3.3/UserDefinedProblem.cs

    r3871 r3880  
    117117    public UserDefinedProblem()
    118118      : base() {
    119       Parameters.Add(new ValueParameter<ISingleObjectiveEvaluator>("Evaluator", "The evaluator that collects the values to exchange."));
     119      Parameters.Add(new ValueParameter<ISingleObjectiveEvaluator>("Evaluator", "The evaluator that collects the values to exchange.", new EmptyUserDefinedProblemEvaluator()));
    120120      Parameters.Add(new ValueParameter<ISolutionCreator>("SolutionCreator", "An operator to create the solution components."));
    121121      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as most test functions are minimization problems.", new BoolValue(false)));
     
    211211    }
    212212    #endregion
     213
     214    [Item("EmptyUserDefinedProblemEvaluator", "A dummy evaluator that will throw an exception when executed.")]
     215    [StorableClass]
     216    private class EmptyUserDefinedProblemEvaluator : ParameterizedNamedItem, ISingleObjectiveEvaluator {
     217      #region ISingleObjectiveEvaluator Members
     218
     219      public ILookupParameter<DoubleValue> QualityParameter {
     220        get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
     221      }
     222
     223      #endregion
     224
     225      public EmptyUserDefinedProblemEvaluator() {
     226        Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The solution quality."));
     227      }
     228
     229      #region IOperator Members
     230
     231      public bool Breakpoint {
     232        get;
     233        set;
     234      }
     235
     236      public IOperation Execute(IExecutionContext context) {
     237        throw new InvalidOperationException("Please choose an appropriate evaluation operator.");
     238      }
     239
     240      public void Abort() {
     241        throw new InvalidOperationException("Please choose an appropriate evaluation operator.");
     242      }
     243
     244      #pragma warning disable 67
     245      public event EventHandler BreakpointChanged;
     246
     247      public event EventHandler Executed;
     248      #pragma warning restore 67
     249
     250      #endregion
     251
     252      public override Image ItemImage {
     253        get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Method; }
     254      }
     255    }
    213256  }
    214257}
Note: See TracChangeset for help on using the changeset viewer.