- Timestamp:
- 04/13/16 16:25:12 (9 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.Designer.cs
r13752 r13757 54 54 this.mapSplitContainer = new System.Windows.Forms.SplitContainer(); 55 55 this.showCharacteristicsCheckBox = new System.Windows.Forms.CheckBox(); 56 this.fromZeroCheckBox = new System.Windows.Forms.CheckBox(); 56 57 this.invPropCheckBox = new System.Windows.Forms.CheckBox(); 57 58 this.sizeLabel = new System.Windows.Forms.Label(); … … 62 63 this.instancesTabPage = new System.Windows.Forms.TabPage(); 63 64 this.problemInstancesView = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 65 this.colorComboBox = new System.Windows.Forms.ComboBox(); 66 this.colorLabel = new System.Windows.Forms.Label(); 64 67 this.problemInstancesTabControl.SuspendLayout(); 65 68 this.mapTabPage.SuspendLayout(); … … 82 85 this.problemInstancesTabControl.Name = "problemInstancesTabControl"; 83 86 this.problemInstancesTabControl.SelectedIndex = 0; 84 this.problemInstancesTabControl.Size = new System.Drawing.Size(1 000, 760);87 this.problemInstancesTabControl.Size = new System.Drawing.Size(1108, 760); 85 88 this.problemInstancesTabControl.TabIndex = 8; 86 89 // … … 91 94 this.mapTabPage.Name = "mapTabPage"; 92 95 this.mapTabPage.Padding = new System.Windows.Forms.Padding(3); 93 this.mapTabPage.Size = new System.Drawing.Size( 992, 734);96 this.mapTabPage.Size = new System.Drawing.Size(1100, 734); 94 97 this.mapTabPage.TabIndex = 1; 95 98 this.mapTabPage.Text = "Map"; … … 106 109 // 107 110 this.mapSplitContainer.Panel1.Controls.Add(this.showCharacteristicsCheckBox); 111 this.mapSplitContainer.Panel1.Controls.Add(this.fromZeroCheckBox); 108 112 this.mapSplitContainer.Panel1.Controls.Add(this.invPropCheckBox); 113 this.mapSplitContainer.Panel1.Controls.Add(this.colorLabel); 109 114 this.mapSplitContainer.Panel1.Controls.Add(this.sizeLabel); 110 115 this.mapSplitContainer.Panel1.Controls.Add(this.projectionLabel); 111 116 this.mapSplitContainer.Panel1.Controls.Add(this.instanceMapChart); 117 this.mapSplitContainer.Panel1.Controls.Add(this.colorComboBox); 112 118 this.mapSplitContainer.Panel1.Controls.Add(this.sizeComboBox); 113 119 this.mapSplitContainer.Panel1.Controls.Add(this.projectionComboBox); 114 120 this.mapSplitContainer.Panel1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0); 115 121 this.mapSplitContainer.Panel2Collapsed = true; 116 this.mapSplitContainer.Size = new System.Drawing.Size( 986, 728);122 this.mapSplitContainer.Size = new System.Drawing.Size(1094, 728); 117 123 this.mapSplitContainer.SplitterDistance = 847; 118 124 this.mapSplitContainer.TabIndex = 12; … … 122 128 this.showCharacteristicsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 123 129 this.showCharacteristicsCheckBox.Appearance = System.Windows.Forms.Appearance.Button; 124 this.showCharacteristicsCheckBox.Location = new System.Drawing.Point( 957, 4);130 this.showCharacteristicsCheckBox.Location = new System.Drawing.Point(1065, 5); 125 131 this.showCharacteristicsCheckBox.Name = "showCharacteristicsCheckBox"; 126 132 this.showCharacteristicsCheckBox.Size = new System.Drawing.Size(26, 23); … … 130 136 this.showCharacteristicsCheckBox.CheckedChanged += new System.EventHandler(this.showCharacteristicsCheckBox_CheckedChanged); 131 137 // 138 // fromZeroCheckBox 139 // 140 this.fromZeroCheckBox.AutoSize = true; 141 this.fromZeroCheckBox.Checked = true; 142 this.fromZeroCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 143 this.fromZeroCheckBox.Location = new System.Drawing.Point(639, 8); 144 this.fromZeroCheckBox.Name = "fromZeroCheckBox"; 145 this.fromZeroCheckBox.Size = new System.Drawing.Size(69, 17); 146 this.fromZeroCheckBox.TabIndex = 17; 147 this.fromZeroCheckBox.Text = "from zero"; 148 this.fromZeroCheckBox.UseVisualStyleBackColor = true; 149 this.fromZeroCheckBox.CheckedChanged += new System.EventHandler(this.fromZeroCheckBox_CheckedChanged); 150 // 132 151 // invPropCheckBox 133 152 // … … 135 154 this.invPropCheckBox.Checked = true; 136 155 this.invPropCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 137 this.invPropCheckBox.Location = new System.Drawing.Point(5 79, 12);156 this.invPropCheckBox.Location = new System.Drawing.Point(515, 8); 138 157 this.invPropCheckBox.Name = "invPropCheckBox"; 139 158 this.invPropCheckBox.Size = new System.Drawing.Size(118, 17); … … 146 165 // 147 166 this.sizeLabel.AutoSize = true; 148 this.sizeLabel.Location = new System.Drawing.Point(2 64, 12);167 this.sizeLabel.Location = new System.Drawing.Point(251, 12); 149 168 this.sizeLabel.Name = "sizeLabel"; 150 169 this.sizeLabel.Size = new System.Drawing.Size(30, 13); … … 192 211 this.instanceMapChart.Series.Add(series1); 193 212 this.instanceMapChart.Series.Add(series2); 194 this.instanceMapChart.Size = new System.Drawing.Size(9 80, 692);213 this.instanceMapChart.Size = new System.Drawing.Size(974, 692); 195 214 this.instanceMapChart.TabIndex = 12; 196 215 // … … 199 218 this.sizeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 200 219 this.sizeComboBox.FormattingEnabled = true; 201 this.sizeComboBox.Location = new System.Drawing.Point( 300, 6);220 this.sizeComboBox.Location = new System.Drawing.Point(287, 6); 202 221 this.sizeComboBox.Name = "sizeComboBox"; 203 this.sizeComboBox.Size = new System.Drawing.Size(2 73, 21);222 this.sizeComboBox.Size = new System.Drawing.Size(222, 21); 204 223 this.sizeComboBox.TabIndex = 13; 205 224 this.sizeComboBox.SelectedIndexChanged += new System.EventHandler(this.SizeComboBoxOnSelectedIndexChanged); … … 221 240 this.instancesTabPage.Name = "instancesTabPage"; 222 241 this.instancesTabPage.Padding = new System.Windows.Forms.Padding(3); 223 this.instancesTabPage.Size = new System.Drawing.Size( 992, 734);242 this.instancesTabPage.Size = new System.Drawing.Size(1106, 734); 224 243 this.instancesTabPage.TabIndex = 0; 225 244 this.instancesTabPage.Text = "Instances"; … … 235 254 this.problemInstancesView.Name = "problemInstancesView"; 236 255 this.problemInstancesView.ReadOnly = false; 237 this.problemInstancesView.Size = new System.Drawing.Size( 986, 728);256 this.problemInstancesView.Size = new System.Drawing.Size(1100, 728); 238 257 this.problemInstancesView.TabIndex = 0; 239 258 this.problemInstancesView.ViewsLabelVisible = true; 240 259 this.problemInstancesView.ViewType = null; 260 // 261 // colorComboBox 262 // 263 this.colorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 264 this.colorComboBox.FormattingEnabled = true; 265 this.colorComboBox.Location = new System.Drawing.Point(768, 6); 266 this.colorComboBox.Name = "colorComboBox"; 267 this.colorComboBox.Size = new System.Drawing.Size(222, 21); 268 this.colorComboBox.TabIndex = 13; 269 this.colorComboBox.SelectedIndexChanged += new System.EventHandler(this.colorComboBox_SelectedIndexChanged); 270 // 271 // colorLabel 272 // 273 this.colorLabel.AutoSize = true; 274 this.colorLabel.Location = new System.Drawing.Point(728, 9); 275 this.colorLabel.Name = "colorLabel"; 276 this.colorLabel.Size = new System.Drawing.Size(34, 13); 277 this.colorLabel.TabIndex = 15; 278 this.colorLabel.Text = "Color:"; 241 279 // 242 280 // UnderstandingProblemInstanceView … … 246 284 this.Controls.Add(this.problemInstancesTabControl); 247 285 this.Name = "UnderstandingProblemInstanceView"; 248 this.Size = new System.Drawing.Size(1 000, 760);286 this.Size = new System.Drawing.Size(1108, 760); 249 287 this.problemInstancesTabControl.ResumeLayout(false); 250 288 this.mapTabPage.ResumeLayout(false); … … 273 311 private System.Windows.Forms.ComboBox sizeComboBox; 274 312 private System.Windows.Forms.ComboBox projectionComboBox; 313 private System.Windows.Forms.CheckBox fromZeroCheckBox; 314 private System.Windows.Forms.Label colorLabel; 315 private System.Windows.Forms.ComboBox colorComboBox; 275 316 } 276 317 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.cs
r13752 r13757 28 28 using System; 29 29 using System.Collections.Generic; 30 using System.Drawing; 30 31 using System.Linq; 31 32 using System.Text.RegularExpressions; … … 62 63 UpdateProjectionComboBox(); 63 64 UpdateSizeComboBox(); 65 UpdateColorComboBox(); 64 66 } 65 67 } … … 76 78 UpdateProjectionComboBox(); 77 79 UpdateSizeComboBox(); 80 UpdateColorComboBox(); 78 81 UpdateProjection(); 79 82 } … … 108 111 } finally { SuppressEvents = false; } 109 112 } 113 114 private void UpdateColorComboBox() { 115 try { 116 SuppressEvents = true; 117 var selected = colorComboBox.SelectedIndex >= 0 ? (string)colorComboBox.SelectedItem : null; 118 colorComboBox.Items.Clear(); 119 colorComboBox.Items.Add(string.Empty); 120 foreach (var str in Content.ProblemInstances.ResultNames.Where(x => x.StartsWith("Rank."))) { 121 colorComboBox.Items.Add(str); 122 if (selected == str) colorComboBox.SelectedItem = str; 123 } 124 if (selected == null && colorComboBox.Items.Count > 0) 125 colorComboBox.SelectedIndex = 0; 126 } finally { SuppressEvents = false; } 127 } 110 128 111 129 private IEnumerable<string> GetProjections() { … … 130 148 var projection = (string)projectionComboBox.SelectedItem; 131 149 var size = sizeComboBox.SelectedIndex >= 0 ? (string)sizeComboBox.SelectedItem : string.Empty; 132 133 DoProjectProblemInstances(instancesSeries, currentInstanceSeries, projection, size, invPropCheckBox.Checked); 134 } 135 136 private void DoProjectProblemInstances(Series instancesSeries, Series currentInstanceSeries, string projection, string size, bool invProp) { 150 var color = colorComboBox.SelectedIndex >= 0 ? (string)colorComboBox.SelectedItem : string.Empty; 151 152 DoProjectProblemInstances(instancesSeries, currentInstanceSeries, projection, 153 size, color, invPropCheckBox.Checked, fromZeroCheckBox.Checked); 154 } 155 156 private void DoProjectProblemInstances(Series instancesSeries, Series currentInstanceSeries, string projection, string size, string color, bool invProp, bool fromZero) { 137 157 instancesSeries.Points.Clear(); 138 158 currentInstanceSeries.Points.Clear(); … … 143 163 if (sizes.Count > 0) { 144 164 maxSize = sizes.Max(x => x.Value); 145 minSize = sizes.Min(x => x.Value); 165 if (maxSize < 0 && fromZero) { 166 maxSize = 0; 167 minSize = sizes.Min(x => x.Value); 168 } else if (fromZero) { 169 minSize = 0; 170 } else { 171 minSize = sizes.Min(x => x.Value); 172 } 146 173 } 147 174 } … … 159 186 if (maxSize > minSize && run.Results.TryGetValue(size, out item)) { 160 187 var dItem = item as Data.DoubleValue; 188 if (dItem == null && item is IntValue) dItem = new DoubleValue(((IntValue)item).Value); 161 189 if (dItem != null) { 162 190 if (double.IsNaN(dItem.Value)) … … 171 199 } else dataPoint.MarkerSize = 1; 172 200 201 if (!string.IsNullOrEmpty(color)) { 202 if (run.Results.TryGetValue(color, out item)) { 203 var v = (int)(item is DoubleValue ? ((DoubleValue)item).Value : (item is IntValue ? ((IntValue)item).Value : int.MaxValue)); 204 switch (v) { 205 case 0: dataPoint.MarkerColor = Color.Green; break; 206 case 1: dataPoint.MarkerColor = Color.LightSeaGreen; break; 207 case 2: dataPoint.MarkerColor = Color.CornflowerBlue; break; 208 case 3: dataPoint.MarkerColor = Color.PaleVioletRed; break; 209 case 4: dataPoint.MarkerColor = Color.IndianRed; break; 210 default: dataPoint.MarkerColor = Color.LightGray; break; 211 } 212 } 213 } 173 214 if (Content.IsCurrentInstance(run)) currentInstanceSeries.Points.Add(dataPoint); 174 215 else instancesSeries.Points.Add(dataPoint); … … 185 226 } 186 227 228 private void colorComboBox_SelectedIndexChanged(object sender, EventArgs e) { 229 UpdateProjection(); 230 } 231 187 232 private void InvPropCheckBoxOnCheckedChanged(object sender, EventArgs e) { 233 UpdateProjection(); 234 } 235 236 private void fromZeroCheckBox_CheckedChanged(object sender, EventArgs e) { 188 237 UpdateProjection(); 189 238 }
Note: See TracChangeset
for help on using the changeset viewer.