Changeset 8331 for branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluator.cs
- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluator.cs
r7259 r8331 24 24 using System.Linq; 25 25 using System.Threading; 26 using Google.ProtocolBuffers; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; … … 35 36 [StorableClass] 36 37 public class ExternalEvaluator : ValuesCollector, IExternalEvaluationProblemEvaluator { 38 protected HashSet<IEvaluationServiceClient> activeClients = new HashSet<IEvaluationServiceClient>(); 39 protected object clientLock = new object(); 37 40 38 41 #region Parameters … … 48 51 #endregion 49 52 50 #region Parameter Values53 #region Parameter Properties 51 54 protected SolutionMessageBuilder MessageBuilder { 52 55 get { return MessageBuilderParameter.Value; } … … 55 58 get { return ClientsParameter.ActualValue; } 56 59 } 57 #endregion58 59 #region Fields60 protected HashSet<IEvaluationServiceClient> activeClients = new HashSet<IEvaluationServiceClient>();61 protected object clientLock = new object();62 60 #endregion 63 61 … … 103 101 } 104 102 105 protected QualityMessage EvaluateOnNextAvailableClient(SolutionMessage message) {103 protected virtual QualityMessage EvaluateOnNextAvailableClient(SolutionMessage message) { 106 104 IEvaluationServiceClient client = null; 107 105 lock (clientLock) { … … 115 113 } 116 114 try { 117 return client.Evaluate(message );115 return client.Evaluate(message, GetQualityMessageExtensions()); 118 116 } finally { 119 117 lock (clientLock) { … … 124 122 } 125 123 126 protected SolutionMessage BuildSolutionMessage() { 124 protected virtual ExtensionRegistry GetQualityMessageExtensions() { 125 return ExtensionRegistry.CreateInstance(); 126 } 127 128 protected virtual SolutionMessage BuildSolutionMessage() { 127 129 lock (clientLock) { 128 130 SolutionMessage.Builder protobufBuilder = SolutionMessage.CreateBuilder();
Note: See TracChangeset
for help on using the changeset viewer.