Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/26/12 09:51:13 (12 years ago)
Author:
jkarder
Message:

#1331: merged r8086:8330 from trunk

Location:
branches/ScatterSearch (trunk integration)
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch (trunk integration)

  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluator.cs

    r7259 r8331  
    2424using System.Linq;
    2525using System.Threading;
     26using Google.ProtocolBuffers;
    2627using HeuristicLab.Common;
    2728using HeuristicLab.Core;
     
    3536  [StorableClass]
    3637  public class ExternalEvaluator : ValuesCollector, IExternalEvaluationProblemEvaluator {
     38    protected HashSet<IEvaluationServiceClient> activeClients = new HashSet<IEvaluationServiceClient>();
     39    protected object clientLock = new object();
    3740
    3841    #region Parameters
     
    4851    #endregion
    4952
    50     #region Parameter Values
     53    #region Parameter Properties
    5154    protected SolutionMessageBuilder MessageBuilder {
    5255      get { return MessageBuilderParameter.Value; }
     
    5558      get { return ClientsParameter.ActualValue; }
    5659    }
    57     #endregion
    58 
    59     #region Fields
    60     protected HashSet<IEvaluationServiceClient> activeClients = new HashSet<IEvaluationServiceClient>();
    61     protected object clientLock = new object();
    6260    #endregion
    6361
     
    103101    }
    104102
    105     protected QualityMessage EvaluateOnNextAvailableClient(SolutionMessage message) {
     103    protected virtual QualityMessage EvaluateOnNextAvailableClient(SolutionMessage message) {
    106104      IEvaluationServiceClient client = null;
    107105      lock (clientLock) {
     
    115113      }
    116114      try {
    117         return client.Evaluate(message);
     115        return client.Evaluate(message, GetQualityMessageExtensions());
    118116      } finally {
    119117        lock (clientLock) {
     
    124122    }
    125123
    126     protected SolutionMessage BuildSolutionMessage() {
     124    protected virtual ExtensionRegistry GetQualityMessageExtensions() {
     125      return ExtensionRegistry.CreateInstance();
     126    }
     127
     128    protected virtual SolutionMessage BuildSolutionMessage() {
    127129      lock (clientLock) {
    128130        SolutionMessage.Builder protobufBuilder = SolutionMessage.CreateBuilder();
Note: See TracChangeset for help on using the changeset viewer.