Changeset 15713 for branches/1614_GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/LocalSolverNet
- Timestamp:
- 02/02/18 16:31:42 (7 years ago)
- Location:
- branches/1614_GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/LocalSolverNet
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1614_GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/LocalSolverNet/GQAPBinarySolver.cs
r15700 r15713 89 89 90 90 if (curObj >= prevObj) return; 91 prevObj = curObj; 92 Context.BestQuality = curObj; 93 91 UpdateSolution(curObj); 92 93 Context.RunOperator(Analyzer, CancellationToken.None); 94 95 if (StoppingCriterion()) localSolver.Stop(); 96 } 97 98 private void UpdateSolution(double obj) { 99 IResult result; 100 prevObj = obj; 101 Context.BestQuality = obj; 102 94 103 if (Results.TryGetValue("BestQuality", out result)) 95 104 ((DoubleValue)result.Value).Value = Context.BestQuality; … … 116 125 result.Value = Context.BestSolution; 117 126 else Results.Add(new Result("BestSolution", Context.BestSolution)); 118 119 Context.RunOperator(Analyzer, CancellationToken.None);120 121 if (StoppingCriterion()) localSolver.Stop();122 127 } 123 128 … … 213 218 localSolver.Solve(); 214 219 220 var curObj = obj.GetDoubleValue(); 221 if (curObj < prevObj) 222 UpdateSolution(curObj); 223 215 224 localSolver.RemoveCallback(LSCallbackType.IterationTicked, LocalSolverOnIterationTicked); 216 225 } finally { -
branches/1614_GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/LocalSolverNet/GQAPIntegerSolver.cs
r15700 r15713 88 88 89 89 if (curObj >= prevObj) return; 90 prevObj = curObj; 91 Context.BestQuality = curObj; 92 90 UpdateSolution(curObj); 91 92 Context.RunOperator(Analyzer, CancellationToken.None); 93 94 if (StoppingCriterion()) localSolver.Stop(); 95 } 96 97 private void UpdateSolution(double obj) { 98 IResult result; 99 prevObj = obj; 100 Context.BestQuality = obj; 101 93 102 if (Results.TryGetValue("BestQuality", out result)) 94 103 ((DoubleValue)result.Value).Value = Context.BestQuality; … … 110 119 result.Value = Context.BestSolution; 111 120 else Results.Add(new Result("BestSolution", Context.BestSolution)); 112 113 Context.RunOperator(Analyzer, CancellationToken.None);114 115 if (StoppingCriterion()) localSolver.Stop();116 121 } 117 122 … … 184 189 185 190 localSolver.Solve(); 191 192 var curObj = obj.GetDoubleValue(); 193 if (curObj < prevObj) 194 UpdateSolution(curObj); 195 196 localSolver.RemoveCallback(LSCallbackType.IterationTicked, LocalSolverOnIterationTicked); 186 197 } finally { 187 198 localSolver.Dispose();
Note: See TracChangeset
for help on using the changeset viewer.