Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/13/11 10:23:49 (13 years ago)
Author:
abeham
Message:

#1619

  • implemented solutions fetching
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs

    r6659 r6660  
    2222using System;
    2323using System.Drawing;
     24using System.Linq;
    2425using System.Windows.Forms;
    2526using HeuristicLab.Common.Resources;
     27using HeuristicLab.Core;
    2628using HeuristicLab.Core.Views;
    2729using HeuristicLab.Data;
     30using HeuristicLab.Encodings.PermutationEncoding;
    2831using HeuristicLab.MainForm;
    2932using HeuristicLab.MainForm.WindowsForms;
     
    106109      string instance = instancesComboBox.SelectedItem as string;
    107110      try {
    108         //Content.LoadEmbeddedInstance(instance);
    109111        using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) {
    110112          var data = client.GetProblemInstanceData(instance);
     
    125127          Content.Weights = weights;
    126128          Content.Distances = distances;
     129
     130          Content.BestKnownQualityParameter.Value = null;
     131          Content.BestKnownSolution = null;
     132          Content.BestKnownSolutions = new ItemSet<Permutation>();
     133          var solutions = client.GetBestSolutionsData(instance);
     134          if (solutions.Any()) {
     135            Content.BestKnownQualityParameter.Value = new DoubleValue(solutions.First().Quality);
     136            Content.BestKnownSolution = new Permutation(PermutationTypes.Absolute, solutions.First().Assignment);
     137            foreach (var solution in solutions) {
     138              Content.BestKnownSolutions.Add(new Permutation(PermutationTypes.Absolute, solution.Assignment));
     139            }
     140          }
    127141        }
    128142      } catch (Exception ex) {
Note: See TracChangeset for help on using the changeset viewer.