Changeset 7999 for trunk/sources/HeuristicLab.Problems.ExternalEvaluation
- Timestamp:
- 06/13/12 17:14:53 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs
r7351 r7999 83 83 get { return (OptionalValueParameter<IScope>)Parameters["BestKnownSolution"]; } 84 84 } 85 public ValueParameter<ItemList<I Operator>> OperatorsParameter {86 get { return (ValueParameter<ItemList<I Operator>>)Parameters["Operators"]; }85 public ValueParameter<ItemList<IItem>> OperatorsParameter { 86 get { return (ValueParameter<ItemList<IItem>>)Parameters["Operators"]; } 87 87 } 88 88 public OptionalValueParameter<EvaluationCache> CacheParameter { … … 117 117 set { BestKnownQualityParameter.Value = value; } 118 118 } 119 public IEnumerable<I Operator> Operators {119 public IEnumerable<IItem> Operators { 120 120 get { return OperatorsParameter.Value; } 121 121 } … … 145 145 Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem.")); 146 146 Parameters.Add(new OptionalValueParameter<IScope>("BestKnownSolution", "The best known solution for this external evaluation problem.")); 147 Parameters.Add(new ValueParameter<ItemList<I Operator>>("Operators", "The operators that are passed to the algorithm.", new ItemList<IOperator>()));147 Parameters.Add(new ValueParameter<ItemList<IItem>>("Operators", "The operators and items that the problem provides to the algorithms.", new ItemList<IItem>())); 148 148 Parameters.Add(new OptionalValueParameter<EvaluationCache>("Cache", "Cache of previously evaluated solutions.")); 149 149 … … 164 164 } 165 165 } 166 167 if (Parameters.ContainsKey("Operators") && Parameters["Operators"] is ValueParameter<ItemList<IOperator>>) { 168 ItemList<IOperator> tmp = ((ValueParameter<ItemList<IOperator>>)Parameters["Operators"]).Value; 169 Parameters.Remove("Operators"); 170 Parameters.Add(new ValueParameter<ItemList<IItem>>("Operators", "The operators and items that the problem provides to the algorithms.", new ItemList<IItem>(tmp), false)); 171 } 166 172 #endregion 167 173 RegisterEventHandlers(); … … 221 227 Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 222 228 OperatorsParameter.ValueChanged += new EventHandler(OperatorsParameter_ValueChanged); 223 OperatorsParameter.Value.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<I Operator>>(OperatorsParameter_Value_ItemsAdded);224 OperatorsParameter.Value.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<I Operator>>(OperatorsParameter_Value_ItemsRemoved);225 OperatorsParameter.Value.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<I Operator>>(OperatorsParameter_Value_CollectionReset);229 OperatorsParameter.Value.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IItem>>(OperatorsParameter_Value_ItemsAdded); 230 OperatorsParameter.Value.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IItem>>(OperatorsParameter_Value_ItemsRemoved); 231 OperatorsParameter.Value.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IItem>>(OperatorsParameter_Value_CollectionReset); 226 232 } 227 233 private void InitializeOperators() { 228 ItemList<I Operator> operators = OperatorsParameter.Value;234 ItemList<IItem> operators = OperatorsParameter.Value; 229 235 operators.Add(new BestScopeSolutionAnalyzer()); 230 236 ParameterizeAnalyzers();
Note: See TracChangeset
for help on using the changeset viewer.