Changeset 4185
- Timestamp:
- 08/10/10 11:32:52 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.Designer.cs
r4015 r4185 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.pictureBox = new System.Windows.Forms.PictureBox();48 47 this.tabControl = new System.Windows.Forms.TabControl(); 49 48 this.visualizationTabPage = new System.Windows.Forms.TabPage(); 49 this.pictureBox = new System.Windows.Forms.PictureBox(); 50 50 this.valueTabPage = new System.Windows.Forms.TabPage(); 51 51 this.tourGroupBox = new System.Windows.Forms.GroupBox(); 52 52 this.tourViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 53 this.splitContainer = new System.Windows.Forms.SplitContainer();54 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();55 this.travelTimeViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();56 this.label6 = new System.Windows.Forms.Label();57 this.tardinessViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();58 this.label5 = new System.Windows.Forms.Label();59 this.overloadViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();60 this.label4 = new System.Windows.Forms.Label();61 this.vehicleUtilizationViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();62 this.label3 = new System.Windows.Forms.Label();63 this.label2 = new System.Windows.Forms.Label();64 this.qualityViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();65 this.label1 = new System.Windows.Forms.Label();66 this.distanceViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();67 ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();68 53 this.tabControl.SuspendLayout(); 69 54 this.visualizationTabPage.SuspendLayout(); 55 ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); 70 56 this.valueTabPage.SuspendLayout(); 71 57 this.tourGroupBox.SuspendLayout(); 72 this.splitContainer.Panel1.SuspendLayout();73 this.splitContainer.Panel2.SuspendLayout();74 this.splitContainer.SuspendLayout();75 this.tableLayoutPanel1.SuspendLayout();76 58 this.SuspendLayout(); 59 // 60 // tabControl 61 // 62 this.tabControl.Controls.Add(this.visualizationTabPage); 63 this.tabControl.Controls.Add(this.valueTabPage); 64 this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; 65 this.tabControl.Location = new System.Drawing.Point(0, 0); 66 this.tabControl.Name = "tabControl"; 67 this.tabControl.SelectedIndex = 0; 68 this.tabControl.Size = new System.Drawing.Size(423, 558); 69 this.tabControl.TabIndex = 1; 70 // 71 // visualizationTabPage 72 // 73 this.visualizationTabPage.Controls.Add(this.pictureBox); 74 this.visualizationTabPage.Location = new System.Drawing.Point(4, 22); 75 this.visualizationTabPage.Name = "visualizationTabPage"; 76 this.visualizationTabPage.Padding = new System.Windows.Forms.Padding(3); 77 this.visualizationTabPage.Size = new System.Drawing.Size(415, 532); 78 this.visualizationTabPage.TabIndex = 0; 79 this.visualizationTabPage.Text = "Visualization"; 80 this.visualizationTabPage.UseVisualStyleBackColor = true; 77 81 // 78 82 // pictureBox … … 85 89 this.pictureBox.Location = new System.Drawing.Point(6, 6); 86 90 this.pictureBox.Name = "pictureBox"; 87 this.pictureBox.Size = new System.Drawing.Size(403, 386);91 this.pictureBox.Size = new System.Drawing.Size(403, 520); 88 92 this.pictureBox.TabIndex = 0; 89 93 this.pictureBox.TabStop = false; 90 94 this.pictureBox.SizeChanged += new System.EventHandler(this.pictureBox_SizeChanged); 91 //92 // tabControl93 //94 this.tabControl.Controls.Add(this.visualizationTabPage);95 this.tabControl.Controls.Add(this.valueTabPage);96 this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;97 this.tabControl.Location = new System.Drawing.Point(0, 0);98 this.tabControl.Name = "tabControl";99 this.tabControl.SelectedIndex = 0;100 this.tabControl.Size = new System.Drawing.Size(423, 424);101 this.tabControl.TabIndex = 0;102 //103 // visualizationTabPage104 //105 this.visualizationTabPage.Controls.Add(this.pictureBox);106 this.visualizationTabPage.Location = new System.Drawing.Point(4, 22);107 this.visualizationTabPage.Name = "visualizationTabPage";108 this.visualizationTabPage.Padding = new System.Windows.Forms.Padding(3);109 this.visualizationTabPage.Size = new System.Drawing.Size(415, 398);110 this.visualizationTabPage.TabIndex = 0;111 this.visualizationTabPage.Text = "Visualization";112 this.visualizationTabPage.UseVisualStyleBackColor = true;113 95 // 114 96 // valueTabPage … … 148 130 this.tourViewHost.ViewType = null; 149 131 // 150 // splitContainer151 //152 this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;153 this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;154 this.splitContainer.IsSplitterFixed = true;155 this.splitContainer.Location = new System.Drawing.Point(0, 0);156 this.splitContainer.Name = "splitContainer";157 this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;158 //159 // splitContainer.Panel1160 //161 this.splitContainer.Panel1.Controls.Add(this.tableLayoutPanel1);162 //163 // splitContainer.Panel2164 //165 this.splitContainer.Panel2.Controls.Add(this.tabControl);166 this.splitContainer.Size = new System.Drawing.Size(423, 558);167 this.splitContainer.SplitterDistance = 130;168 this.splitContainer.TabIndex = 0;169 //170 // tableLayoutPanel1171 //172 this.tableLayoutPanel1.ColumnCount = 2;173 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23.64066F));174 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 76.35934F));175 this.tableLayoutPanel1.Controls.Add(this.travelTimeViewHost, 1, 5);176 this.tableLayoutPanel1.Controls.Add(this.label6, 0, 5);177 this.tableLayoutPanel1.Controls.Add(this.tardinessViewHost, 1, 4);178 this.tableLayoutPanel1.Controls.Add(this.label5, 0, 4);179 this.tableLayoutPanel1.Controls.Add(this.overloadViewHost, 1, 3);180 this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3);181 this.tableLayoutPanel1.Controls.Add(this.vehicleUtilizationViewHost, 1, 2);182 this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);183 this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);184 this.tableLayoutPanel1.Controls.Add(this.qualityViewHost, 1, 0);185 this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);186 this.tableLayoutPanel1.Controls.Add(this.distanceViewHost, 1, 1);187 this.tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;188 this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);189 this.tableLayoutPanel1.Name = "tableLayoutPanel1";190 this.tableLayoutPanel1.RowCount = 6;191 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));192 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));193 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));194 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));195 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));196 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));197 this.tableLayoutPanel1.Size = new System.Drawing.Size(423, 121);198 this.tableLayoutPanel1.TabIndex = 2;199 //200 // travelTimeViewHost201 //202 this.travelTimeViewHost.Caption = "View";203 this.travelTimeViewHost.Content = null;204 this.travelTimeViewHost.Dock = System.Windows.Forms.DockStyle.Left;205 this.travelTimeViewHost.Location = new System.Drawing.Point(102, 103);206 this.travelTimeViewHost.Name = "travelTimeViewHost";207 this.travelTimeViewHost.ReadOnly = false;208 this.travelTimeViewHost.Size = new System.Drawing.Size(281, 15);209 this.travelTimeViewHost.TabIndex = 17;210 this.travelTimeViewHost.ViewType = null;211 //212 // label6213 //214 this.label6.AutoSize = true;215 this.label6.Dock = System.Windows.Forms.DockStyle.Fill;216 this.label6.Location = new System.Drawing.Point(3, 100);217 this.label6.Name = "label6";218 this.label6.Size = new System.Drawing.Size(93, 21);219 this.label6.TabIndex = 16;220 this.label6.Text = "Travel Time";221 this.label6.TextAlign = System.Drawing.ContentAlignment.BottomLeft;222 //223 // tardinessViewHost224 //225 this.tardinessViewHost.Caption = "View";226 this.tardinessViewHost.Content = null;227 this.tardinessViewHost.Dock = System.Windows.Forms.DockStyle.Left;228 this.tardinessViewHost.Location = new System.Drawing.Point(102, 83);229 this.tardinessViewHost.Name = "tardinessViewHost";230 this.tardinessViewHost.ReadOnly = false;231 this.tardinessViewHost.Size = new System.Drawing.Size(281, 14);232 this.tardinessViewHost.TabIndex = 15;233 this.tardinessViewHost.ViewType = null;234 //235 // label5236 //237 this.label5.AutoSize = true;238 this.label5.Dock = System.Windows.Forms.DockStyle.Fill;239 this.label5.Location = new System.Drawing.Point(3, 80);240 this.label5.Name = "label5";241 this.label5.Size = new System.Drawing.Size(93, 20);242 this.label5.TabIndex = 14;243 this.label5.Text = "Tardiness";244 this.label5.TextAlign = System.Drawing.ContentAlignment.BottomLeft;245 //246 // overloadViewHost247 //248 this.overloadViewHost.BackColor = System.Drawing.Color.Transparent;249 this.overloadViewHost.Caption = "View";250 this.overloadViewHost.Content = null;251 this.overloadViewHost.Dock = System.Windows.Forms.DockStyle.Left;252 this.overloadViewHost.Location = new System.Drawing.Point(102, 63);253 this.overloadViewHost.Name = "overloadViewHost";254 this.overloadViewHost.ReadOnly = false;255 this.overloadViewHost.Size = new System.Drawing.Size(281, 14);256 this.overloadViewHost.TabIndex = 13;257 this.overloadViewHost.ViewType = null;258 //259 // label4260 //261 this.label4.AutoSize = true;262 this.label4.Dock = System.Windows.Forms.DockStyle.Fill;263 this.label4.Location = new System.Drawing.Point(3, 60);264 this.label4.Name = "label4";265 this.label4.Size = new System.Drawing.Size(93, 20);266 this.label4.TabIndex = 12;267 this.label4.Text = "Overload";268 this.label4.TextAlign = System.Drawing.ContentAlignment.BottomLeft;269 //270 // vehicleUtilizationViewHost271 //272 this.vehicleUtilizationViewHost.Caption = "View";273 this.vehicleUtilizationViewHost.Content = null;274 this.vehicleUtilizationViewHost.Dock = System.Windows.Forms.DockStyle.Left;275 this.vehicleUtilizationViewHost.Location = new System.Drawing.Point(102, 43);276 this.vehicleUtilizationViewHost.Name = "vehicleUtilizationViewHost";277 this.vehicleUtilizationViewHost.ReadOnly = false;278 this.vehicleUtilizationViewHost.Size = new System.Drawing.Size(281, 14);279 this.vehicleUtilizationViewHost.TabIndex = 11;280 this.vehicleUtilizationViewHost.ViewType = null;281 //282 // label3283 //284 this.label3.AutoSize = true;285 this.label3.Dock = System.Windows.Forms.DockStyle.Fill;286 this.label3.Location = new System.Drawing.Point(3, 40);287 this.label3.Name = "label3";288 this.label3.Size = new System.Drawing.Size(93, 20);289 this.label3.TabIndex = 10;290 this.label3.Text = "Vehicle utilization";291 this.label3.TextAlign = System.Drawing.ContentAlignment.BottomLeft;292 //293 // label2294 //295 this.label2.AutoSize = true;296 this.label2.Dock = System.Windows.Forms.DockStyle.Fill;297 this.label2.Location = new System.Drawing.Point(3, 20);298 this.label2.Name = "label2";299 this.label2.Size = new System.Drawing.Size(93, 20);300 this.label2.TabIndex = 9;301 this.label2.Text = "Distance";302 this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft;303 //304 // qualityViewHost305 //306 this.qualityViewHost.BackColor = System.Drawing.Color.Transparent;307 this.qualityViewHost.Caption = "View";308 this.qualityViewHost.Content = null;309 this.qualityViewHost.Dock = System.Windows.Forms.DockStyle.Left;310 this.qualityViewHost.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));311 this.qualityViewHost.Location = new System.Drawing.Point(102, 3);312 this.qualityViewHost.Name = "qualityViewHost";313 this.qualityViewHost.ReadOnly = false;314 this.qualityViewHost.Size = new System.Drawing.Size(281, 14);315 this.qualityViewHost.TabIndex = 8;316 this.qualityViewHost.ViewType = null;317 //318 // label1319 //320 this.label1.AutoSize = true;321 this.label1.Dock = System.Windows.Forms.DockStyle.Fill;322 this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));323 this.label1.Location = new System.Drawing.Point(3, 0);324 this.label1.Name = "label1";325 this.label1.Size = new System.Drawing.Size(93, 20);326 this.label1.TabIndex = 0;327 this.label1.Text = "Quality";328 this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;329 //330 // distanceViewHost331 //332 this.distanceViewHost.BackColor = System.Drawing.Color.Transparent;333 this.distanceViewHost.Caption = "View";334 this.distanceViewHost.Content = null;335 this.distanceViewHost.Dock = System.Windows.Forms.DockStyle.Left;336 this.distanceViewHost.Location = new System.Drawing.Point(102, 23);337 this.distanceViewHost.Name = "distanceViewHost";338 this.distanceViewHost.ReadOnly = false;339 this.distanceViewHost.Size = new System.Drawing.Size(281, 14);340 this.distanceViewHost.TabIndex = 7;341 this.distanceViewHost.ViewType = null;342 //343 132 // VRPSolutionView 344 133 // 345 134 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 346 135 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 347 this.Controls.Add(this. splitContainer);136 this.Controls.Add(this.tabControl); 348 137 this.Name = "VRPSolutionView"; 349 138 this.Size = new System.Drawing.Size(423, 558); 350 ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();351 139 this.tabControl.ResumeLayout(false); 352 140 this.visualizationTabPage.ResumeLayout(false); 141 ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); 353 142 this.valueTabPage.ResumeLayout(false); 354 143 this.tourGroupBox.ResumeLayout(false); 355 this.splitContainer.Panel1.ResumeLayout(false);356 this.splitContainer.Panel2.ResumeLayout(false);357 this.splitContainer.ResumeLayout(false);358 this.tableLayoutPanel1.ResumeLayout(false);359 this.tableLayoutPanel1.PerformLayout();360 144 this.ResumeLayout(false); 361 145 … … 364 148 #endregion 365 149 366 private System.Windows.Forms.PictureBox pictureBox;367 150 private System.Windows.Forms.TabControl tabControl; 368 151 private System.Windows.Forms.TabPage visualizationTabPage; 152 private System.Windows.Forms.PictureBox pictureBox; 369 153 private System.Windows.Forms.TabPage valueTabPage; 370 154 private System.Windows.Forms.GroupBox tourGroupBox; 371 private HeuristicLab.MainForm.WindowsForms.ViewHost tourViewHost; 372 private System.Windows.Forms.SplitContainer splitContainer; 373 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 374 private System.Windows.Forms.Label label1; 375 private HeuristicLab.MainForm.WindowsForms.ViewHost travelTimeViewHost; 376 private System.Windows.Forms.Label label6; 377 private HeuristicLab.MainForm.WindowsForms.ViewHost tardinessViewHost; 378 private System.Windows.Forms.Label label5; 379 private HeuristicLab.MainForm.WindowsForms.ViewHost overloadViewHost; 380 private System.Windows.Forms.Label label4; 381 private HeuristicLab.MainForm.WindowsForms.ViewHost vehicleUtilizationViewHost; 382 private System.Windows.Forms.Label label3; 383 private System.Windows.Forms.Label label2; 384 private HeuristicLab.MainForm.WindowsForms.ViewHost qualityViewHost; 385 private HeuristicLab.MainForm.WindowsForms.ViewHost distanceViewHost; 155 private MainForm.WindowsForms.ViewHost tourViewHost; 156 386 157 387 158 -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.cs
r4174 r4185 45 45 public VRPSolutionView() { 46 46 InitializeComponent(); 47 48 ToolTip tt = new ToolTip(); 49 tt.SetToolTip(pictureBox, "Legend: Blue = Depot, Black = City (OK), Orange = City (too early), Red = City (too late)"); 47 50 } 48 51 49 52 protected override void DeregisterContentEvents() { 50 Content.QualityChanged -= new EventHandler(Content_QualityChanged);51 Content.DistanceChanged -= new EventHandler(Content_DistanceChanged);52 Content.OverloadChanged -= new EventHandler(Content_OverloadChanged);53 Content.TardinessChanged -= new EventHandler(Content_TardinessChanged);54 Content.TravelTimeChanged -= new EventHandler(Content_TravelTimeChanged);55 Content.VehicleUtilizationChanged -= new EventHandler(Content_VehicleUtilizationChanged);56 53 Content.CoordinatesChanged -= new EventHandler(Content_CoordinatesChanged); 57 54 Content.SolutionChanged -= new EventHandler(Content_SolutionChanged); … … 60 57 protected override void RegisterContentEvents() { 61 58 base.RegisterContentEvents(); 62 Content.QualityChanged += new EventHandler(Content_QualityChanged);63 Content.DistanceChanged += new EventHandler(Content_DistanceChanged);64 Content.OverloadChanged += new EventHandler(Content_OverloadChanged);65 Content.TardinessChanged += new EventHandler(Content_TardinessChanged);66 Content.TravelTimeChanged += new EventHandler(Content_TravelTimeChanged);67 Content.VehicleUtilizationChanged += new EventHandler(Content_VehicleUtilizationChanged);68 59 Content.CoordinatesChanged += new EventHandler(Content_CoordinatesChanged); 69 60 Content.SolutionChanged += new EventHandler(Content_SolutionChanged); … … 75 66 pictureBox.Image = null; 76 67 } else { 77 qualityViewHost.Content = Content.Quality;78 distanceViewHost.Content = Content.Distance;79 overloadViewHost.Content = Content.Overload;80 tardinessViewHost.Content = Content.Tardiness;81 travelTimeViewHost.Content = Content.TravelTime;82 vehicleUtilizationViewHost.Content = Content.VehicleUtilization;83 84 68 GenerateImage(); 85 69 tourViewHost.Content = Content.Solution; … … 94 78 protected override void SetEnabledStateOfControls() { 95 79 base.SetEnabledStateOfControls(); 96 tableLayoutPanel1.Enabled = Content != null;97 80 pictureBox.Enabled = Content != null; 98 81 tourGroupBox.Enabled = Content != null; … … 139 122 double t = 0.0; 140 123 Point[] tourPoints = new Point[tour.Cities.Count + 2]; 124 Brush[] customerBrushes = new Brush[tour.Cities.Count]; 141 125 int lastCustomer = 0; 142 126 … … 161 145 if (t < readyTime[location]) { 162 146 t = readyTime[location]; 163 customerBrush = Brushes. Yellow;147 customerBrush = Brushes.Orange; 164 148 } else if (t > dueTime[location]) { 165 149 customerBrush = Brushes.Red; … … 167 151 168 152 t += serviceTime[location]; 169 170 graphics.FillRectangle(customerBrush, locationPoint.X - 2, locationPoint.Y - 2, 6, 6); 153 customerBrushes[i] = customerBrush; 171 154 } 172 155 lastCustomer = location; … … 174 157 175 158 graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints); 159 160 for (int i = 0; i < tour.Cities.Count; i++) { 161 graphics.FillRectangle(customerBrushes[i], tourPoints[i + 1].X - 3, tourPoints[i + 1].Y - 3, 6, 6); 162 } 163 164 graphics.FillEllipse(Brushes.Blue, tourPoints[0].X - 5, tourPoints[0].Y - 5, 10, 10); 165 176 166 currentTour++; 177 167 } 168 } else { 169 Point locationPoint; 170 //just draw customers 171 for (int i = 1; i < coordinates.Rows; i++) { 172 locationPoint = new Point(border + ((int)((coordinates[i, 0] - xMin) * xStep)), 173 bitmap.Height - (border + ((int)((coordinates[i, 1] - yMin) * yStep)))); 174 175 graphics.FillRectangle(Brushes.Black, locationPoint.X - 3, locationPoint.Y - 3, 6, 6); 176 } 177 178 locationPoint = new Point(border + ((int)((coordinates[0, 0] - xMin) * xStep)), 179 bitmap.Height - (border + ((int)((coordinates[0, 1] - yMin) * yStep)))); 180 graphics.FillEllipse(Brushes.Blue, locationPoint.X - 5, locationPoint.Y - 5, 10, 10); 178 181 } 179 182 } … … 188 191 } 189 192 190 private void Content_QualityChanged(object sender, EventArgs e) {191 if (InvokeRequired)192 Invoke(new EventHandler(Content_QualityChanged), sender, e);193 else194 qualityViewHost.Content = Content.Quality;195 }196 void Content_DistanceChanged(object sender, EventArgs e) {197 if (InvokeRequired)198 Invoke(new EventHandler(Content_DistanceChanged), sender, e);199 else200 distanceViewHost.Content = Content.Distance;201 }202 193 private void Content_CoordinatesChanged(object sender, EventArgs e) { 203 194 if (InvokeRequired) … … 205 196 else 206 197 GenerateImage(); 207 }208 void Content_OverloadChanged(object sender, EventArgs e) {209 if (InvokeRequired)210 Invoke(new EventHandler(Content_OverloadChanged), sender, e);211 else212 overloadViewHost.Content = Content.Overload;213 }214 void Content_TardinessChanged(object sender, EventArgs e) {215 if (InvokeRequired)216 Invoke(new EventHandler(Content_TardinessChanged), sender, e);217 else218 tardinessViewHost.Content = Content.Tardiness;219 }220 void Content_TravelTimeChanged(object sender, EventArgs e) {221 if (InvokeRequired)222 Invoke(new EventHandler(Content_TravelTimeChanged), sender, e);223 else224 travelTimeViewHost.Content = Content.TravelTime;225 }226 void Content_VehicleUtilizationChanged(object sender, EventArgs e) {227 if (InvokeRequired)228 Invoke(new EventHandler(Content_VehicleUtilizationChanged), sender, e);229 else230 vehicleUtilizationViewHost.Content = Content.VehicleUtilization;231 198 } 232 199 private void Content_SolutionChanged(object sender, EventArgs e) { -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.Designer.cs
r3938 r4185 25 25 private void InitializeComponent() { 26 26 this.importButton = new System.Windows.Forms.Button(); 27 this.tabControl1 = new System.Windows.Forms.TabControl(); 28 this.tabPage1 = new System.Windows.Forms.TabPage(); 29 this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView(); 30 this.tabPage2 = new System.Windows.Forms.TabPage(); 31 this.vrpSolutionView = new HeuristicLab.Problems.VehicleRouting.Views.VRPSolutionView(); 27 32 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 33 this.tabControl1.SuspendLayout(); 34 this.tabPage1.SuspendLayout(); 35 this.tabPage2.SuspendLayout(); 28 36 this.SuspendLayout(); 29 //30 // parameterCollectionView31 //32 this.parameterCollectionView.Location = new System.Drawing.Point(0, 88);33 this.parameterCollectionView.Size = new System.Drawing.Size(490, 334);34 37 // 35 38 // nameTextBox … … 50 53 this.importButton.Click += new System.EventHandler(this.importButton_Click); 51 54 // 55 // tabControl1 56 // 57 this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 58 | System.Windows.Forms.AnchorStyles.Left) 59 | System.Windows.Forms.AnchorStyles.Right))); 60 this.tabControl1.Controls.Add(this.tabPage1); 61 this.tabControl1.Controls.Add(this.tabPage2); 62 this.tabControl1.Location = new System.Drawing.Point(0, 84); 63 this.tabControl1.Name = "tabControl1"; 64 this.tabControl1.SelectedIndex = 0; 65 this.tabControl1.Size = new System.Drawing.Size(490, 338); 66 this.tabControl1.TabIndex = 6; 67 // 68 // tabPage1 69 // 70 this.tabPage1.Controls.Add(this.parameterCollectionView); 71 this.tabPage1.Location = new System.Drawing.Point(4, 22); 72 this.tabPage1.Name = "tabPage1"; 73 this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 74 this.tabPage1.Size = new System.Drawing.Size(482, 312); 75 this.tabPage1.TabIndex = 0; 76 this.tabPage1.Text = "Parameters"; 77 this.tabPage1.UseVisualStyleBackColor = true; 78 // 79 // parameterCollectionView 80 // 81 this.parameterCollectionView.Caption = "ParameterCollection View"; 82 this.parameterCollectionView.Content = null; 83 this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill; 84 this.parameterCollectionView.Location = new System.Drawing.Point(3, 3); 85 this.parameterCollectionView.Name = "parameterCollectionView"; 86 this.parameterCollectionView.ReadOnly = false; 87 this.parameterCollectionView.Size = new System.Drawing.Size(476, 306); 88 this.parameterCollectionView.TabIndex = 1; 89 // 90 // tabPage2 91 // 92 this.tabPage2.Controls.Add(this.vrpSolutionView); 93 this.tabPage2.Location = new System.Drawing.Point(4, 22); 94 this.tabPage2.Name = "tabPage2"; 95 this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 96 this.tabPage2.Size = new System.Drawing.Size(482, 312); 97 this.tabPage2.TabIndex = 1; 98 this.tabPage2.Text = "Visualization"; 99 this.tabPage2.UseVisualStyleBackColor = true; 100 // 101 // vrpSolutionView 102 // 103 this.vrpSolutionView.Caption = "VRPSolution View"; 104 this.vrpSolutionView.Content = null; 105 this.vrpSolutionView.Dock = System.Windows.Forms.DockStyle.Fill; 106 this.vrpSolutionView.Location = new System.Drawing.Point(3, 3); 107 this.vrpSolutionView.Name = "vrpSolutionView"; 108 this.vrpSolutionView.ReadOnly = false; 109 this.vrpSolutionView.Size = new System.Drawing.Size(476, 306); 110 this.vrpSolutionView.TabIndex = 0; 111 // 52 112 // VehicleRoutingProblemView 53 113 // 54 114 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 55 115 this.Controls.Add(this.importButton); 116 this.Controls.Add(this.tabControl1); 56 117 this.Name = "VehicleRoutingProblemView"; 57 118 this.Size = new System.Drawing.Size(490, 422); 119 this.Controls.SetChildIndex(this.tabControl1, 0); 58 120 this.Controls.SetChildIndex(this.importButton, 0); 59 121 this.Controls.SetChildIndex(this.nameTextBox, 0); … … 61 123 this.Controls.SetChildIndex(this.descriptionLabel, 0); 62 124 this.Controls.SetChildIndex(this.descriptionTextBox, 0); 63 this.Controls.SetChildIndex(this.parameterCollectionView, 0);64 125 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 126 this.tabControl1.ResumeLayout(false); 127 this.tabPage1.ResumeLayout(false); 128 this.tabPage2.ResumeLayout(false); 65 129 this.ResumeLayout(false); 66 130 this.PerformLayout(); … … 71 135 72 136 private System.Windows.Forms.Button importButton; 137 private System.Windows.Forms.TabControl tabControl1; 138 private System.Windows.Forms.TabPage tabPage1; 139 private System.Windows.Forms.TabPage tabPage2; 140 private Core.Views.ParameterCollectionView parameterCollectionView; 141 private VRPSolutionView vrpSolutionView; 73 142 } 74 143 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.cs
r4068 r4185 24 24 using HeuristicLab.MainForm; 25 25 using HeuristicLab.Optimization.Views; 26 using HeuristicLab.Core.Views; 27 using HeuristicLab.Core; 26 28 27 29 namespace HeuristicLab.Problems.VehicleRouting.Views { 28 30 [View("VehicleRouting Problem View")] 29 31 [Content(typeof(VehicleRoutingProblem), true)] 30 public partial class VehicleRoutingProblemView : ProblemView {32 public partial class VehicleRoutingProblemView : NamedItemView { 31 33 public new VehicleRoutingProblem Content { 32 34 get { return (VehicleRoutingProblem)base.Content; } … … 36 38 public VehicleRoutingProblemView() { 37 39 InitializeComponent(); 40 } 41 42 protected override void DeregisterContentEvents() { 43 Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged); 44 base.DeregisterContentEvents(); 45 } 46 protected override void RegisterContentEvents() { 47 base.RegisterContentEvents(); 48 Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged); 49 } 50 51 protected override void OnContentChanged() { 52 base.OnContentChanged(); 53 if (Content == null) { 54 parameterCollectionView.Content = null; 55 vrpSolutionView.Content = null; 56 } else { 57 parameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters; 58 vrpSolutionView.Content = new VRPSolution(Content.Coordinates); 59 } 60 } 61 62 protected override void SetEnabledStateOfControls() { 63 base.SetEnabledStateOfControls(); 64 parameterCollectionView.Enabled = Content != null; 65 vrpSolutionView.Enabled = Content != null; 66 importButton.Enabled = Content != null && !ReadOnly; 38 67 } 39 68 … … 46 75 } 47 76 } 77 78 private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) { 79 vrpSolutionView.Content.Coordinates = Content.Coordinates; 80 } 48 81 } 49 82 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestVRPSolutionAnalyzer.cs
r4184 r4185 127 127 BestSolutionParameter.ActualValue = solution; 128 128 results.Add(new Result("Best VRP Solution", solution)); 129 129 130 results.Add(new Result("Best TravelTime", new DoubleValue(travelTimes[i].Value))); 130 131 results.Add(new Result("Best Distance", new DoubleValue(distances[i].Value))); 132 results.Add(new Result("Best VehicleUtilization", new DoubleValue(vehiclesUtilizations[i].Value))); 131 133 results.Add(new Result("Best Overload", new DoubleValue(overloads[i].Value))); 132 134 results.Add(new Result("Best Tardiness", new DoubleValue(tardinesses[i].Value))); 133 results.Add(new Result("Best TravelTime", new DoubleValue(travelTimes[i].Value)));134 results.Add(new Result("Best VehicleUtilization", new DoubleValue(vehiclesUtilizations[i].Value)));135 135 } else { 136 136 if (solution.Quality.Value > qualities[i].Value) { -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/VRPSolution.cs
r4015 r4185 195 195 public VRPSolution() : base() { } 196 196 197 public VRPSolution(DoubleMatrix coordinates): base() { 198 this.coordinates = coordinates; 199 } 200 197 201 public VRPSolution(DoubleMatrix coordinates, IVRPEncoding solution, DoubleValue quality, 198 202 DoubleValue distance, DoubleValue overload, DoubleValue tardiness, DoubleValue travelTime,
Note: See TracChangeset
for help on using the changeset viewer.