Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/17 14:42:41 (7 years ago)
Author:
mkommend
Message:

#2774: Allowed storing additional data in the scope of an individual.

Location:
trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblem.cs

    r14185 r14877  
    158158      try {
    159159        return client.Evaluate(message, GetQualityMessageExtensions());
    160       } finally {
     160      }
     161      finally {
    161162        lock (clientLock) {
    162163          activeClients.Remove(client);
     
    170171        SolutionMessage.Builder protobufBuilder = SolutionMessage.CreateBuilder();
    171172        protobufBuilder.SolutionId = solutionId;
    172         var scope = new Scope();
    173         individual.CopyToScope(scope);
    174         foreach (var variable in scope.Variables) {
     173        foreach (var variable in individual.Values) {
    175174          try {
    176             MessageBuilder.AddToMessage(variable.Value, variable.Name, protobufBuilder);
    177           } catch (ArgumentException ex) {
     175            MessageBuilder.AddToMessage(variable.Value, variable.Key, protobufBuilder);
     176          }
     177          catch (ArgumentException ex) {
    178178            throw new InvalidOperationException(string.Format("ERROR while building solution message: Parameter {0} cannot be added to the message", Name), ex);
    179179          }
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/MultiObjectiveExternalEvaluationProblem.cs

    r14185 r14877  
    155155      try {
    156156        return client.Evaluate(message, GetQualityMessageExtensions());
    157       } finally {
     157      }
     158      finally {
    158159        lock (clientLock) {
    159160          activeClients.Remove(client);
     
    167168        SolutionMessage.Builder protobufBuilder = SolutionMessage.CreateBuilder();
    168169        protobufBuilder.SolutionId = solutionId;
    169         var scope = new Scope();
    170         individual.CopyToScope(scope);
    171         foreach (var variable in scope.Variables) {
     170        foreach (var variable in individual.Values) {
    172171          try {
    173             MessageBuilder.AddToMessage(variable.Value, variable.Name, protobufBuilder);
    174           } catch (ArgumentException ex) {
     172            MessageBuilder.AddToMessage(variable.Value, variable.Key, protobufBuilder);
     173          }
     174          catch (ArgumentException ex) {
    175175            throw new InvalidOperationException(string.Format("ERROR while building solution message: Parameter {0} cannot be added to the message", Name), ex);
    176176          }
Note: See TracChangeset for help on using the changeset viewer.