Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/15/12 17:28:37 (13 years ago)
Author:
abeham
Message:

#1614

  • Removed incompatible problem linhp318.tsp (contains fixed edges)
  • Fixed AssemblyInfo for TSPLIB
  • Added unit tests
  • Worked on assignment / solution view
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentView.cs

    r7448 r7470  
    4949    protected override void DeregisterContentEvents() {
    5050      Content.PropertyChanged -= new PropertyChangedEventHandler(Content_PropertyChanged);
    51       Content.Solution.PropertyChanged -= new PropertyChangedEventHandler(ContentSolution_PropertyChanged);
    5251      base.DeregisterContentEvents();
    5352    }
     
    5554      base.RegisterContentEvents();
    5655      Content.PropertyChanged += new PropertyChangedEventHandler(Content_PropertyChanged);
    57       Content.Solution.PropertyChanged += new PropertyChangedEventHandler(ContentSolution_PropertyChanged);
    5856    }
    5957    #endregion
     
    7573    private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    7674      switch (e.PropertyName) {
    77         case "EquipmentNames": UpdateAssignment(); break;
    78         case "LocationNames": UpdateAssignment(); break;
    79         default: break;
    80       }
    81     }
    82     private void ContentSolution_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    83       switch (e.PropertyName) {
    8475        case "Quality": UpdateQuality(); break;
    8576        case "FlowDistanceQuality": UpdateFlowDistanceQuality(); break;
     
    8778        case "OverbookedCapacity": UpdateOverbookedCapacity(); break;
    8879        case "Assignment": UpdateAssignment(); break;
     80        case "EquipmentNames": UpdateAssignment(); break;
     81        case "LocationNames": UpdateAssignment(); break;
    8982        default: break;
    9083      }
     84    }
     85
     86    private void Content_Assignment_ToStringChanged(object sender, EventArgs e) {
     87      UpdateAssignment();
    9188    }
    9289    #endregion
     
    129126          qualityLabel.Text = "-";
    130127        } else {
    131           qualityLabel.Text = Content.Solution.Quality.ToString();
     128          qualityLabel.Text = Content.Quality.ToString();
    132129        }
    133130      }
     
    137134      if (InvokeRequired) Invoke((Action)UpdateFlowDistanceQuality);
    138135      else {
    139         if (Content == null || Content.Solution.FlowDistanceQuality == null) {
     136        if (Content == null || Content.FlowDistanceQuality == null) {
    140137          flowDistanceQualityLabel.Text = "-";
    141138        } else {
    142           flowDistanceQualityLabel.Text = Content.Solution.FlowDistanceQuality.ToString();
     139          flowDistanceQualityLabel.Text = Content.FlowDistanceQuality.ToString();
    143140        }
    144141      }
     
    148145      if (InvokeRequired) Invoke((Action)UpdateInstallationQuality);
    149146      else {
    150         if (Content == null || Content.Solution.InstallationQuality == null) {
     147        if (Content == null || Content.InstallationQuality == null) {
    151148          installationQualityLabel.Text = "-";
    152149        } else {
    153           installationQualityLabel.Text = Content.Solution.InstallationQuality.ToString();
     150          installationQualityLabel.Text = Content.InstallationQuality.ToString();
    154151        }
    155152      }
     
    159156      if (InvokeRequired) Invoke((Action)UpdateOverbookedCapacity);
    160157      else {
    161         if (Content == null || Content.Solution.OverbookedCapacity == null) {
     158        if (Content == null || Content.OverbookedCapacity == null) {
    162159          overbookedCapacityLabel.Text = "-";
    163160        } else {
    164           overbookedCapacityLabel.Text = Content.Solution.OverbookedCapacity.ToString();
     161          overbookedCapacityLabel.Text = Content.OverbookedCapacity.ToString();
    165162        }
    166163      }
     
    172169        assignmentTreeView.Nodes.Clear();
    173170        if (Content != null) {
    174           IntegerVector assignment = Content.Solution.Assignment;
     171          IntegerVector assignment = Content.Assignment;
    175172          Dictionary<int, TreeNode> locationNodes = new Dictionary<int, TreeNode>();
    176173          for (int i = 0; i < assignment.Length; i++) {
     
    202199      var installationCosts = new Dictionary<EquipmentNode, double>();
    203200      foreach (var node in GetAllSubNodes(assignmentTreeView.Nodes).OfType<EquipmentNode>()) {
    204         int location = Content.Solution.Assignment[node.Equipment];
     201        int location = Content.Assignment[node.Equipment];
    205202        installationCosts[node] = Content.InstallationCosts[node.Equipment, location];
    206203      }
     
    249246
    250247    private void ColorByWeight(LocationNode selectedNode) {
    251       var equipments = new HashSet<int>(Content.Solution.Assignment.Select((v, i) => new { Index = i, Value = v })
     248      var equipments = new HashSet<int>(Content.Assignment.Select((v, i) => new { Index = i, Value = v })
    252249        .Where(x => x.Value == selectedNode.Location).Select(x => x.Index));
    253250      var rowSums = new Dictionary<int, double>(equipments.Count);
Note: See TracChangeset for help on using the changeset viewer.