Changeset 4315
- Timestamp:
- 08/25/10 13:50:51 (14 years ago)
- Location:
- branches/VRP
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.Designer.cs
r4232 r4315 31 31 this.vrpSolutionView = new HeuristicLab.Problems.VehicleRouting.Views.VRPSolutionView(); 32 32 this.importButton2 = new System.Windows.Forms.Button(); 33 this.importButton3 = new System.Windows.Forms.Button(); 33 34 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 34 35 this.tabControl1.SuspendLayout(); … … 61 62 this.tabControl1.Controls.Add(this.tabPage1); 62 63 this.tabControl1.Controls.Add(this.tabPage2); 63 this.tabControl1.Location = new System.Drawing.Point(0, 1 09);64 this.tabControl1.Location = new System.Drawing.Point(0, 139); 64 65 this.tabControl1.Name = "tabControl1"; 65 66 this.tabControl1.SelectedIndex = 0; 66 this.tabControl1.Size = new System.Drawing.Size(490, 313);67 this.tabControl1.Size = new System.Drawing.Size(490, 283); 67 68 this.tabControl1.TabIndex = 6; 68 69 // … … 73 74 this.tabPage1.Name = "tabPage1"; 74 75 this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 75 this.tabPage1.Size = new System.Drawing.Size(482, 2 87);76 this.tabPage1.Size = new System.Drawing.Size(482, 257); 76 77 this.tabPage1.TabIndex = 0; 77 78 this.tabPage1.Text = "Parameters"; … … 86 87 this.parameterCollectionView.Name = "parameterCollectionView"; 87 88 this.parameterCollectionView.ReadOnly = false; 88 this.parameterCollectionView.Size = new System.Drawing.Size(476, 2 81);89 this.parameterCollectionView.Size = new System.Drawing.Size(476, 251); 89 90 this.parameterCollectionView.TabIndex = 1; 90 91 // … … 123 124 this.importButton2.Click += new System.EventHandler(this.importButton2_Click); 124 125 // 126 // importButton3 127 // 128 this.importButton3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 129 | System.Windows.Forms.AnchorStyles.Right))); 130 this.importButton3.Location = new System.Drawing.Point(0, 110); 131 this.importButton3.Name = "importButton3"; 132 this.importButton3.Size = new System.Drawing.Size(490, 23); 133 this.importButton3.TabIndex = 8; 134 this.importButton3.Text = "Import from ORLib"; 135 this.importButton3.UseVisualStyleBackColor = true; 136 this.importButton3.Click += new System.EventHandler(this.importButton3_Click); 137 // 125 138 // VehicleRoutingProblemView 126 139 // 127 140 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 141 this.Controls.Add(this.importButton3); 128 142 this.Controls.Add(this.importButton2); 129 143 this.Controls.Add(this.importButton); … … 138 152 this.Controls.SetChildIndex(this.descriptionTextBox, 0); 139 153 this.Controls.SetChildIndex(this.importButton2, 0); 154 this.Controls.SetChildIndex(this.importButton3, 0); 140 155 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 141 156 this.tabControl1.ResumeLayout(false); … … 156 171 private VRPSolutionView vrpSolutionView; 157 172 private System.Windows.Forms.Button importButton2; 173 private System.Windows.Forms.Button importButton3; 158 174 } 159 175 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.cs
r4232 r4315 69 69 private void importButton_Click(object sender, EventArgs e) { 70 70 OpenFileDialog dialog = new OpenFileDialog(); 71 dialog. DefaultExt = "txt";71 dialog.Filter = "Solomon files (*.txt)|*.txt"; 72 72 73 73 if (dialog.ShowDialog() == DialogResult.OK) { … … 78 78 private void importButton2_Click(object sender, EventArgs e) { 79 79 OpenFileDialog dialog = new OpenFileDialog(); 80 dialog.DefaultExt = " vrp";80 dialog.DefaultExt = "TSPLib files (*.vrp)|*.vrp"; 81 81 82 82 if (dialog.ShowDialog() == DialogResult.OK) { … … 85 85 } 86 86 87 private void importButton3_Click(object sender, EventArgs e) { 88 OpenFileDialog dialog = new OpenFileDialog(); 89 dialog.DefaultExt = "ORLib files (*.txt)|*.txt"; 90 91 if (dialog.ShowDialog() == DialogResult.OK) { 92 Content.ImportFromORLib(dialog.FileName); 93 } 94 } 95 87 96 private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) { 88 97 vrpSolutionView.Content.Coordinates = Content.Coordinates; 89 } 98 } 90 99 } 91 100 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/HeuristicLab.Problems.VehicleRouting-3.3.csproj
r4301 r4315 179 179 <Compile Include="Encodings\Zhu\ZhuEncoding.cs" /> 180 180 <Compile Include="Interfaces\IVRPMoveMaker.cs" /> 181 <Compile Include="ORLIBParser.cs" /> 181 182 <Compile Include="TSPLIBParser.cs" /> 182 183 <Compile Include="VRPUtilities.cs" /> -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/VehicleRoutingProblem.cs
r4301 r4315 483 483 } 484 484 485 public void ImportFromORLib(string orFileName) { 486 ORLIBParser parser = new ORLIBParser(orFileName); 487 parser.Parse(); 488 489 this.Name = parser.Name; 490 int problemSize = parser.Demands.Length; 491 492 Coordinates = new DoubleMatrix(parser.Vertices); 493 Vehicles.Value = problemSize - 1; 494 Capacity.Value = parser.Capacity; 495 Demand = new DoubleArray(parser.Demands); 496 ReadyTime = new DoubleArray(problemSize); 497 DueTime = new DoubleArray(problemSize); 498 ServiceTime = new DoubleArray(problemSize); 499 500 ReadyTime[0] = 0; 501 DueTime[0] = parser.MaxRouteTime; 502 ServiceTime[0] = 0; 503 504 for (int i = 1; i < problemSize; i++) { 505 ReadyTime[i] = 0; 506 DueTime[i] = int.MaxValue; 507 ServiceTime[i] = parser.ServiceTime; 508 } 509 510 OnReset(); 511 } 512 485 513 private void InitializeRandomVRPInstance() { 486 514 System.Random rand = new System.Random();
Note: See TracChangeset
for help on using the changeset viewer.