Changeset 15973 for branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblem.cs
- Timestamp:
- 06/28/18 11:13:37 (7 years ago)
- Location:
- branches/2522_RefactorPluginInfrastructure
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2522_RefactorPluginInfrastructure
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblem.cs
r13257 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 59 59 get { return (IFixedValueParameter<SingleObjectiveOptimizationSupportScript>)Parameters["SupportScript"]; } 60 60 } 61 62 private IFixedValueParameter<BoolValue> MaximizationParameter { 63 get { return (IFixedValueParameter<BoolValue>)Parameters["Maximization"]; } 64 } 61 65 #endregion 62 66 63 67 #region Properties 68 public new IEncoding Encoding { 69 get { return base.Encoding; } 70 set { base.Encoding = value; } 71 } 64 72 public EvaluationCache Cache { 65 73 get { return CacheParameter.Value; } … … 100 108 public override bool Maximization { 101 109 get { return Parameters.ContainsKey("Maximization") && ((IValueParameter<BoolValue>)Parameters["Maximization"]).Value.Value; } 110 } 111 112 public virtual void SetMaximization(bool maximization) { 113 MaximizationParameter.Value.Value = maximization; 102 114 } 103 115 … … 146 158 try { 147 159 return client.Evaluate(message, GetQualityMessageExtensions()); 148 } finally { 160 } 161 finally { 149 162 lock (clientLock) { 150 163 activeClients.Remove(client); … … 158 171 SolutionMessage.Builder protobufBuilder = SolutionMessage.CreateBuilder(); 159 172 protobufBuilder.SolutionId = solutionId; 160 var scope = new Scope(); 161 individual.CopyToScope(scope); 162 foreach (var variable in scope.Variables) { 173 foreach (var variable in individual.Values) { 163 174 try { 164 MessageBuilder.AddToMessage(variable.Value, variable.Name, protobufBuilder); 165 } catch (ArgumentException ex) { 175 MessageBuilder.AddToMessage(variable.Value, variable.Key, protobufBuilder); 176 } 177 catch (ArgumentException ex) { 166 178 throw new InvalidOperationException(string.Format("ERROR while building solution message: Parameter {0} cannot be added to the message", Name), ex); 167 179 }
Note: See TracChangeset
for help on using the changeset viewer.