Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/15/12 17:28:37 (12 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
Location:
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3
Files:
4 edited

Legend:

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

    r7438 r7470  
    5656      this.label3 = new System.Windows.Forms.Label();
    5757      this.flowDistanceQualityLabel = new System.Windows.Forms.Label();
     58      this.assignmentSplitContainer = new System.Windows.Forms.SplitContainer();
     59      this.assignmentView = new HeuristicLab.Data.Views.StringConvertibleArrayView();
    5860      this.assignmentGroupBox.SuspendLayout();
    5961      this.characteristicsGroupBox.SuspendLayout();
     62      ((System.ComponentModel.ISupportInitialize)(this.assignmentSplitContainer)).BeginInit();
     63      this.assignmentSplitContainer.Panel1.SuspendLayout();
     64      this.assignmentSplitContainer.Panel2.SuspendLayout();
     65      this.assignmentSplitContainer.SuspendLayout();
    6066      this.SuspendLayout();
    6167      //
    6268      // assignmentTreeView
    6369      //
    64       this.assignmentTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    65                   | System.Windows.Forms.AnchorStyles.Left)
    66                   | System.Windows.Forms.AnchorStyles.Right)));
    67       this.assignmentTreeView.Location = new System.Drawing.Point(6, 19);
     70      this.assignmentTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
     71      this.assignmentTreeView.Location = new System.Drawing.Point(0, 0);
    6872      this.assignmentTreeView.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3);
    6973      this.assignmentTreeView.Name = "assignmentTreeView";
    70       this.assignmentTreeView.Size = new System.Drawing.Size(228, 331);
     74      this.assignmentTreeView.Size = new System.Drawing.Size(78, 337);
    7175      this.assignmentTreeView.TabIndex = 3;
    7276      this.assignmentTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.assignmentTreeView_AfterSelect);
     
    9599      // assignmentGroupBox
    96100      //
    97       this.assignmentGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    98                   | System.Windows.Forms.AnchorStyles.Left)
    99                   | System.Windows.Forms.AnchorStyles.Right)));
    100       this.assignmentGroupBox.Controls.Add(this.assignmentTreeView);
     101      this.assignmentGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     102            | System.Windows.Forms.AnchorStyles.Left)
     103            | System.Windows.Forms.AnchorStyles.Right)));
     104      this.assignmentGroupBox.Controls.Add(this.assignmentSplitContainer);
    101105      this.assignmentGroupBox.Location = new System.Drawing.Point(217, 3);
    102106      this.assignmentGroupBox.Name = "assignmentGroupBox";
     
    108112      // characteristicsGroupBox
    109113      //
    110       this.characteristicsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    111                   | System.Windows.Forms.AnchorStyles.Left)));
     114      this.characteristicsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     115            | System.Windows.Forms.AnchorStyles.Left)));
    112116      this.characteristicsGroupBox.Controls.Add(this.label7);
    113117      this.characteristicsGroupBox.Controls.Add(this.overbookedCapacityLabel);
     
    185189      this.flowDistanceQualityLabel.Text = "-";
    186190      //
     191      // assignmentSplitContainer
     192      //
     193      this.assignmentSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
     194      this.assignmentSplitContainer.Location = new System.Drawing.Point(3, 16);
     195      this.assignmentSplitContainer.Name = "assignmentSplitContainer";
     196      //
     197      // assignmentSplitContainer.Panel1
     198      //
     199      this.assignmentSplitContainer.Panel1.Controls.Add(this.assignmentTreeView);
     200      //
     201      // assignmentSplitContainer.Panel2
     202      //
     203      this.assignmentSplitContainer.Panel2.Controls.Add(this.assignmentView);
     204      this.assignmentSplitContainer.Size = new System.Drawing.Size(234, 337);
     205      this.assignmentSplitContainer.SplitterDistance = 78;
     206      this.assignmentSplitContainer.TabIndex = 4;
     207      //
     208      // assignmentView
     209      //
     210      this.assignmentView.Caption = "StringConvertibleArray View";
     211      this.assignmentView.Content = null;
     212      this.assignmentView.Dock = System.Windows.Forms.DockStyle.Fill;
     213      this.assignmentView.Location = new System.Drawing.Point(0, 0);
     214      this.assignmentView.Name = "assignmentView";
     215      this.assignmentView.ReadOnly = false;
     216      this.assignmentView.Size = new System.Drawing.Size(152, 337);
     217      this.assignmentView.TabIndex = 0;
     218      //
    187219      // GQAPAssignmentView
    188220      //
     
    196228      this.characteristicsGroupBox.ResumeLayout(false);
    197229      this.characteristicsGroupBox.PerformLayout();
     230      this.assignmentSplitContainer.Panel1.ResumeLayout(false);
     231      this.assignmentSplitContainer.Panel2.ResumeLayout(false);
     232      ((System.ComponentModel.ISupportInitialize)(this.assignmentSplitContainer)).EndInit();
     233      this.assignmentSplitContainer.ResumeLayout(false);
    198234      this.ResumeLayout(false);
    199235
     
    213249    private System.Windows.Forms.Label label5;
    214250    private System.Windows.Forms.Label installationQualityLabel;
     251    private System.Windows.Forms.SplitContainer assignmentSplitContainer;
     252    private Data.Views.StringConvertibleArrayView assignmentView;
    215253  }
    216254}
  • 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);
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views-3.3.csproj

    r7448 r7470  
    5454      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
    5555    </Reference>
     56    <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    5657    <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3">
    5758      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.IntegerVectorEncoding-3.3.dll</HintPath>
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/ProblemInstanceProviderView.cs

    r7466 r7470  
    6060      var instance = (IInstanceDescriptor)instancesComboBox.SelectedItem;
    6161      if (!Content.FeedConsumer(instance)) {
    62         MessageBox.Show("Loading the problem instance " + instance.Name + " failed.");
     62        MessageBox.Show("This problem does not support the instance " + instance.Name + ".", "Cannot load instance");
    6363      }
    6464    }
Note: See TracChangeset for help on using the changeset viewer.