Changeset 7470 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3
- Timestamp:
- 02/15/12 17:28:37 (13 years ago)
- 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 56 56 this.label3 = new System.Windows.Forms.Label(); 57 57 this.flowDistanceQualityLabel = new System.Windows.Forms.Label(); 58 this.assignmentSplitContainer = new System.Windows.Forms.SplitContainer(); 59 this.assignmentView = new HeuristicLab.Data.Views.StringConvertibleArrayView(); 58 60 this.assignmentGroupBox.SuspendLayout(); 59 61 this.characteristicsGroupBox.SuspendLayout(); 62 ((System.ComponentModel.ISupportInitialize)(this.assignmentSplitContainer)).BeginInit(); 63 this.assignmentSplitContainer.Panel1.SuspendLayout(); 64 this.assignmentSplitContainer.Panel2.SuspendLayout(); 65 this.assignmentSplitContainer.SuspendLayout(); 60 66 this.SuspendLayout(); 61 67 // 62 68 // assignmentTreeView 63 69 // 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); 68 72 this.assignmentTreeView.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3); 69 73 this.assignmentTreeView.Name = "assignmentTreeView"; 70 this.assignmentTreeView.Size = new System.Drawing.Size( 228, 331);74 this.assignmentTreeView.Size = new System.Drawing.Size(78, 337); 71 75 this.assignmentTreeView.TabIndex = 3; 72 76 this.assignmentTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.assignmentTreeView_AfterSelect); … … 95 99 // assignmentGroupBox 96 100 // 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 100 this.assignmentGroupBox.Controls.Add(this.assignment TreeView);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); 101 105 this.assignmentGroupBox.Location = new System.Drawing.Point(217, 3); 102 106 this.assignmentGroupBox.Name = "assignmentGroupBox"; … … 108 112 // characteristicsGroupBox 109 113 // 110 this.characteristicsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 111 114 this.characteristicsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 115 | System.Windows.Forms.AnchorStyles.Left))); 112 116 this.characteristicsGroupBox.Controls.Add(this.label7); 113 117 this.characteristicsGroupBox.Controls.Add(this.overbookedCapacityLabel); … … 185 189 this.flowDistanceQualityLabel.Text = "-"; 186 190 // 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 // 187 219 // GQAPAssignmentView 188 220 // … … 196 228 this.characteristicsGroupBox.ResumeLayout(false); 197 229 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); 198 234 this.ResumeLayout(false); 199 235 … … 213 249 private System.Windows.Forms.Label label5; 214 250 private System.Windows.Forms.Label installationQualityLabel; 251 private System.Windows.Forms.SplitContainer assignmentSplitContainer; 252 private Data.Views.StringConvertibleArrayView assignmentView; 215 253 } 216 254 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentView.cs
r7448 r7470 49 49 protected override void DeregisterContentEvents() { 50 50 Content.PropertyChanged -= new PropertyChangedEventHandler(Content_PropertyChanged); 51 Content.Solution.PropertyChanged -= new PropertyChangedEventHandler(ContentSolution_PropertyChanged);52 51 base.DeregisterContentEvents(); 53 52 } … … 55 54 base.RegisterContentEvents(); 56 55 Content.PropertyChanged += new PropertyChangedEventHandler(Content_PropertyChanged); 57 Content.Solution.PropertyChanged += new PropertyChangedEventHandler(ContentSolution_PropertyChanged);58 56 } 59 57 #endregion … … 75 73 private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) { 76 74 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) {84 75 case "Quality": UpdateQuality(); break; 85 76 case "FlowDistanceQuality": UpdateFlowDistanceQuality(); break; … … 87 78 case "OverbookedCapacity": UpdateOverbookedCapacity(); break; 88 79 case "Assignment": UpdateAssignment(); break; 80 case "EquipmentNames": UpdateAssignment(); break; 81 case "LocationNames": UpdateAssignment(); break; 89 82 default: break; 90 83 } 84 } 85 86 private void Content_Assignment_ToStringChanged(object sender, EventArgs e) { 87 UpdateAssignment(); 91 88 } 92 89 #endregion … … 129 126 qualityLabel.Text = "-"; 130 127 } else { 131 qualityLabel.Text = Content. Solution.Quality.ToString();128 qualityLabel.Text = Content.Quality.ToString(); 132 129 } 133 130 } … … 137 134 if (InvokeRequired) Invoke((Action)UpdateFlowDistanceQuality); 138 135 else { 139 if (Content == null || Content. Solution.FlowDistanceQuality == null) {136 if (Content == null || Content.FlowDistanceQuality == null) { 140 137 flowDistanceQualityLabel.Text = "-"; 141 138 } else { 142 flowDistanceQualityLabel.Text = Content. Solution.FlowDistanceQuality.ToString();139 flowDistanceQualityLabel.Text = Content.FlowDistanceQuality.ToString(); 143 140 } 144 141 } … … 148 145 if (InvokeRequired) Invoke((Action)UpdateInstallationQuality); 149 146 else { 150 if (Content == null || Content. Solution.InstallationQuality == null) {147 if (Content == null || Content.InstallationQuality == null) { 151 148 installationQualityLabel.Text = "-"; 152 149 } else { 153 installationQualityLabel.Text = Content. Solution.InstallationQuality.ToString();150 installationQualityLabel.Text = Content.InstallationQuality.ToString(); 154 151 } 155 152 } … … 159 156 if (InvokeRequired) Invoke((Action)UpdateOverbookedCapacity); 160 157 else { 161 if (Content == null || Content. Solution.OverbookedCapacity == null) {158 if (Content == null || Content.OverbookedCapacity == null) { 162 159 overbookedCapacityLabel.Text = "-"; 163 160 } else { 164 overbookedCapacityLabel.Text = Content. Solution.OverbookedCapacity.ToString();161 overbookedCapacityLabel.Text = Content.OverbookedCapacity.ToString(); 165 162 } 166 163 } … … 172 169 assignmentTreeView.Nodes.Clear(); 173 170 if (Content != null) { 174 IntegerVector assignment = Content. Solution.Assignment;171 IntegerVector assignment = Content.Assignment; 175 172 Dictionary<int, TreeNode> locationNodes = new Dictionary<int, TreeNode>(); 176 173 for (int i = 0; i < assignment.Length; i++) { … … 202 199 var installationCosts = new Dictionary<EquipmentNode, double>(); 203 200 foreach (var node in GetAllSubNodes(assignmentTreeView.Nodes).OfType<EquipmentNode>()) { 204 int location = Content. Solution.Assignment[node.Equipment];201 int location = Content.Assignment[node.Equipment]; 205 202 installationCosts[node] = Content.InstallationCosts[node.Equipment, location]; 206 203 } … … 249 246 250 247 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 }) 252 249 .Where(x => x.Value == selectedNode.Location).Select(x => x.Index)); 253 250 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 54 54 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 55 55 </Reference> 56 <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 56 57 <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3"> 57 58 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.IntegerVectorEncoding-3.3.dll</HintPath> -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/ProblemInstanceProviderView.cs
r7466 r7470 60 60 var instance = (IInstanceDescriptor)instancesComboBox.SelectedItem; 61 61 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"); 63 63 } 64 64 }
Note: See TracChangeset
for help on using the changeset viewer.