- Timestamp:
- 05/31/10 16:26:37 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/UserDefinedProblem.cs
r3871 r3880 117 117 public UserDefinedProblem() 118 118 : 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())); 120 120 Parameters.Add(new ValueParameter<ISolutionCreator>("SolutionCreator", "An operator to create the solution components.")); 121 121 Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as most test functions are minimization problems.", new BoolValue(false))); … … 211 211 } 212 212 #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 } 213 256 } 214 257 }
Note: See TracChangeset
for help on using the changeset viewer.