Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/14/18 12:01:42 (6 years ago)
Author:
abeham
Message:

#2936: Added integration branch

Location:
branches/2936_GQAPIntegration
Files:
1 added
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/2936_GQAPIntegration/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/GRASP/GRASP.cs

    r15704 r16077  
    3131using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3232
    33 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms.GRASP {
     33namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms {
    3434
    3535  /// <summary>
     
    159159      Results.Add(new Result("EvaluatedSolutions", new IntValue(Context.EvaluatedSolutions)));
    160160      Results.Add(new Result("BestQuality", new DoubleValue(Context.BestQuality)));
    161       Results.Add(new Result("BestSolution", typeof(GQAPSolution)));
     161      Results.Add(new Result("BestSolution", typeof(GQAPAssignment)));
    162162    }
    163163
     
    249249          ((DoubleValue)result.Value).Value = Context.BestQuality;
    250250        else Results.Add(new Result("BestQuality", new DoubleValue(Context.BestQuality)));
    251         if (Results.TryGetValue("BestSolution", out result))
    252           result.Value = Context.BestSolution;
    253         else Results.Add(new Result("BestSolution", Context.BestSolution));
     251        if (Results.TryGetValue("BestSolution", out result)) {
     252          var solAssign = (GQAPAssignment)result.Value;
     253          if (solAssign != null) {
     254            solAssign.Solution = Context.BestSolution;
     255          } else {
     256            result.Value = new GQAPAssignment(Context.BestSolution, Problem.ProblemInstance);
     257          }
     258        } else Results.Add(new Result("BestSolution", new GQAPAssignment(Context.BestSolution, Problem.ProblemInstance)));
    254259
    255260        try {
Note: See TracChangeset for help on using the changeset viewer.