Changeset 3859 for trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs
- Timestamp:
- 05/26/10 15:18:42 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs
r3852 r3859 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 24 using HeuristicLab.Parameters; 25 using System.Drawing; 26 using HeuristicLab.Optimization; 27 using HeuristicLab.Data; 28 using HeuristicLab.Operators; 25 29 26 30 namespace HeuristicLab.Problems.ExternalEvaluation { 27 31 [Item("External Evaluation Problem", "A problem that is evaluated in a different process.")] 28 32 [StorableClass] 29 public class ExternalEvaluationProblem : ParameterizedNamedItem { 33 public class ExternalEvaluationProblem : ParameterizedNamedItem, ISingleObjectiveProblem { 34 public override Image ItemImage { 35 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; } 36 } 37 30 38 #region Parameters 39 private IValueParameter<IExternalEvaluationDriver> DriverParameter { 40 get { return (IValueParameter<IExternalEvaluationDriver>)Parameters["Driver"]; } 41 } 42 private IValueParameter<IExternalEvaluationProblemEvaluator> EvaluatorParameter { 43 get { return (IValueParameter<IExternalEvaluationProblemEvaluator>)Parameters["Evaluator"]; } 44 } 45 public ValueParameter<BoolValue> MaximizationParameter { 46 get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; } 47 } 48 IParameter ISingleObjectiveProblem.MaximizationParameter { 49 get { return MaximizationParameter; } 50 } 51 public ValueParameter<IOperator> SolutionCreatorParameter { 52 get { return (ValueParameter<IOperator>)Parameters["SolutionCreator"]; } 53 } 54 IParameter IProblem.SolutionCreatorParameter { 55 get { return SolutionCreatorParameter; } 56 } 57 IParameter IProblem.EvaluatorParameter { 58 get { return EvaluatorParameter; } 59 } 60 public OptionalValueParameter<DoubleValue> BestKnownQualityParameter { 61 get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; } 62 } 63 IParameter ISingleObjectiveProblem.BestKnownQualityParameter { 64 get { return BestKnownQualityParameter; } 65 } 66 public OptionalValueParameter<IScope> BestKnownSolutionParameter { 67 get { return (OptionalValueParameter<IScope>)Parameters["BestKnownSolution"]; } 68 } 31 69 #endregion 32 70 33 71 public ExternalEvaluationProblem() 34 72 : base() { 73 ExternalEvaluator evaluator = new ExternalEvaluator(); 74 EmptyOperator solutionCreator = new EmptyOperator(); 75 35 76 Parameters.Add(new ValueParameter<IExternalEvaluationDriver>("Driver", "The communication driver that is used to exchange data with the external process.")); 77 Parameters.Add(new ValueParameter<IExternalEvaluationProblemEvaluator>("Evaluator", "The evaluator that collects the values to exchange.", evaluator)); 78 Parameters.Add(new ValueParameter<IOperator>("SolutionCreator", "An operator to create the solution components.", solutionCreator)); 36 79 } 37 80 }
Note: See TracChangeset
for help on using the changeset viewer.