Changeset 6195 for branches/histogram/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs
- Timestamp:
- 05/14/11 16:45:46 (13 years ago)
- Location:
- branches/histogram
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/histogram
-
branches/histogram/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs
r5809 r6195 53 53 54 54 #region Parameters 55 public IValueParameter< IEvaluationServiceClient> ClientParameter {56 get { return (IValueParameter< IEvaluationServiceClient>)Parameters["Client"]; }55 public IValueParameter<CheckedItemCollection<IEvaluationServiceClient>> ClientsParameter { 56 get { return (IValueParameter<CheckedItemCollection<IEvaluationServiceClient>>)Parameters["Clients"]; } 57 57 } 58 58 public IValueParameter<IExternalEvaluationProblemEvaluator> EvaluatorParameter { … … 85 85 public ValueParameter<ItemList<IOperator>> OperatorsParameter { 86 86 get { return (ValueParameter<ItemList<IOperator>>)Parameters["Operators"]; } 87 } 88 public OptionalValueParameter<EvaluationCache> CacheParameter { 89 get { return (OptionalValueParameter<EvaluationCache>)Parameters["Cache"]; } 87 90 } 88 91 #endregion … … 141 144 UserDefinedSolutionCreator solutionCreator = new UserDefinedSolutionCreator(); 142 145 143 Parameters.Add(new ValueParameter< IEvaluationServiceClient>("Client", "The client that is used to communicate with the external application.", new EvaluationServiceClient()));146 Parameters.Add(new ValueParameter<CheckedItemCollection<IEvaluationServiceClient>>("Clients", "The clients that are used to communicate with the external application.", new CheckedItemCollection<IEvaluationServiceClient>() { new EvaluationServiceClient() })); 144 147 Parameters.Add(new ValueParameter<IExternalEvaluationProblemEvaluator>("Evaluator", "The evaluator that collects the values to exchange.", evaluator)); 145 148 Parameters.Add(new ValueParameter<ISolutionCreator>("SolutionCreator", "An operator to create the solution components.", solutionCreator)); … … 148 151 Parameters.Add(new OptionalValueParameter<IScope>("BestKnownSolution", "The best known solution for this external evaluation problem.")); 149 152 Parameters.Add(new ValueParameter<ItemList<IOperator>>("Operators", "The operators that are passed to the algorithm.", new ItemList<IOperator>())); 153 Parameters.Add(new OptionalValueParameter<EvaluationCache>("Cache", "Cache of previously evaluated solutions.")); 150 154 151 155 InitializeOperators(); 152 156 AttachEventHandlers(); 157 } 158 [StorableHook(HookType.AfterDeserialization)] 159 private void AfterDeserialization() { 160 // BackwardsCompatibility3.3 161 #region Backwards compatible code, remove with 3.4 162 if (!Parameters.ContainsKey("Clients")) { 163 Parameters.Add(new ValueParameter<CheckedItemCollection<IEvaluationServiceClient>>("Clients", "The clients that are used to communicate with the external application.", new CheckedItemCollection<IEvaluationServiceClient>() { new EvaluationServiceClient() })); 164 if (Parameters.ContainsKey("Client")) { 165 var client = ((IValueParameter<IEvaluationServiceClient>)Parameters["Client"]).Value; 166 if (client != null) 167 ClientsParameter.Value = new CheckedItemCollection<IEvaluationServiceClient>() { client }; 168 Parameters.Remove("Client"); 169 } 170 } 171 #endregion 153 172 } 154 173 … … 223 242 } 224 243 private void ParameterizeEvaluator() { 225 Evaluator.Client Parameter.ActualName = ClientParameter.Name;244 Evaluator.ClientsParameter.ActualName = ClientsParameter.Name; 226 245 } 227 246 private void ParameterizeOperators() {
Note: See TracChangeset
for help on using the changeset viewer.