Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/11 16:45:46 (13 years ago)
Author:
abeham
Message:

#1465

  • updated branch with latest version of trunk
Location:
branches/histogram
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram

  • branches/histogram/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs

    r5809 r6195  
    5353
    5454    #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"]; }
    5757    }
    5858    public IValueParameter<IExternalEvaluationProblemEvaluator> EvaluatorParameter {
     
    8585    public ValueParameter<ItemList<IOperator>> OperatorsParameter {
    8686      get { return (ValueParameter<ItemList<IOperator>>)Parameters["Operators"]; }
     87    }
     88    public OptionalValueParameter<EvaluationCache> CacheParameter {
     89      get { return (OptionalValueParameter<EvaluationCache>)Parameters["Cache"]; }
    8790    }
    8891    #endregion
     
    141144      UserDefinedSolutionCreator solutionCreator = new UserDefinedSolutionCreator();
    142145
    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() }));
    144147      Parameters.Add(new ValueParameter<IExternalEvaluationProblemEvaluator>("Evaluator", "The evaluator that collects the values to exchange.", evaluator));
    145148      Parameters.Add(new ValueParameter<ISolutionCreator>("SolutionCreator", "An operator to create the solution components.", solutionCreator));
     
    148151      Parameters.Add(new OptionalValueParameter<IScope>("BestKnownSolution", "The best known solution for this external evaluation problem."));
    149152      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."));
    150154
    151155      InitializeOperators();
    152156      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
    153172    }
    154173
     
    223242    }
    224243    private void ParameterizeEvaluator() {
    225       Evaluator.ClientParameter.ActualName = ClientParameter.Name;
     244      Evaluator.ClientsParameter.ActualName = ClientsParameter.Name;
    226245    }
    227246    private void ParameterizeOperators() {
Note: See TracChangeset for help on using the changeset viewer.