Changeset 4619 for trunk/sources/HeuristicLab.Problems.VehicleRouting.Views
- Timestamp:
- 10/19/10 13:22:55 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/HeuristicLab.Problems.VehicleRouting.Views-3.3.csproj
r4065 r4619 172 172 <Name>HeuristicLab.MainForm-3.3</Name> 173 173 </ProjectReference> 174 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> 175 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 176 <Name>HeuristicLab.Operators-3.3</Name> 177 </ProjectReference> 174 178 <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj"> 175 179 <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project> -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/HeuristicLabProblemsVehicleRoutingViewsPlugin.cs.frame
r4497 r4619 38 38 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 39 39 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 [PluginDependency("HeuristicLab.Operators", "3.3")] 40 41 [PluginDependency("HeuristicLab.Optimization.Views", "3.3")] 41 42 [PluginDependency("HeuristicLab.Parameters", "3.3")] -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.Designer.cs
r4352 r4619 123 123 this.tourGridView.Location = new System.Drawing.Point(3, 16); 124 124 this.tourGridView.Name = "tourGridView"; 125 this.tourGridView.ReadOnly = true; 125 126 this.tourGridView.Size = new System.Drawing.Size(403, 507); 126 127 this.tourGridView.TabIndex = 0; -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.Designer.cs
r4352 r4619 31 31 this.importButton2 = new System.Windows.Forms.Button(); 32 32 this.importButton3 = new System.Windows.Forms.Button(); 33 this.importBestButton = new System.Windows.Forms.Button(); 33 34 this.vrpSolutionView = new HeuristicLab.Problems.VehicleRouting.Views.VRPSolutionView(); 34 35 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); … … 60 61 this.tabControl1.Controls.Add(this.tabPage1); 61 62 this.tabControl1.Controls.Add(this.tabPage2); 62 this.tabControl1.Location = new System.Drawing.Point(0, 84);63 this.tabControl1.Location = new System.Drawing.Point(0, 111); 63 64 this.tabControl1.Name = "tabControl1"; 64 65 this.tabControl1.SelectedIndex = 0; 65 this.tabControl1.Size = new System.Drawing.Size(490, 2 65);66 this.tabControl1.Size = new System.Drawing.Size(490, 255); 66 67 this.tabControl1.TabIndex = 6; 67 68 // … … 72 73 this.tabPage1.Name = "tabPage1"; 73 74 this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 74 this.tabPage1.Size = new System.Drawing.Size(482, 2 39);75 this.tabPage1.Size = new System.Drawing.Size(482, 229); 75 76 this.tabPage1.TabIndex = 0; 76 77 this.tabPage1.Text = "Parameters"; … … 79 80 // parameterCollectionView 80 81 // 82 this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 83 | System.Windows.Forms.AnchorStyles.Left) 84 | System.Windows.Forms.AnchorStyles.Right))); 81 85 this.parameterCollectionView.Caption = "ParameterCollection View"; 82 86 this.parameterCollectionView.Content = null; 83 this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;84 87 this.parameterCollectionView.Location = new System.Drawing.Point(3, 3); 85 88 this.parameterCollectionView.Name = "parameterCollectionView"; 86 89 this.parameterCollectionView.ReadOnly = false; 87 this.parameterCollectionView.Size = new System.Drawing.Size(476, 2 33);90 this.parameterCollectionView.Size = new System.Drawing.Size(476, 223); 88 91 this.parameterCollectionView.TabIndex = 1; 89 92 // … … 94 97 this.tabPage2.Name = "tabPage2"; 95 98 this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 96 this.tabPage2.Size = new System.Drawing.Size(482, 2 39);99 this.tabPage2.Size = new System.Drawing.Size(482, 229); 97 100 this.tabPage2.TabIndex = 1; 98 101 this.tabPage2.Text = "Visualization"; … … 119 122 this.importButton3.Click += new System.EventHandler(this.importButton3_Click); 120 123 // 124 // importBestButton 125 // 126 this.importBestButton.Location = new System.Drawing.Point(0, 82); 127 this.importBestButton.Name = "importBestButton"; 128 this.importBestButton.Size = new System.Drawing.Size(139, 23); 129 this.importBestButton.TabIndex = 9; 130 this.importBestButton.Text = "Import solution"; 131 this.importBestButton.UseVisualStyleBackColor = true; 132 this.importBestButton.Click += new System.EventHandler(this.importBestButton_Click); 133 // 121 134 // vrpSolutionView 122 135 // … … 127 140 this.vrpSolutionView.Name = "vrpSolutionView"; 128 141 this.vrpSolutionView.ReadOnly = false; 129 this.vrpSolutionView.Size = new System.Drawing.Size(476, 2 33);142 this.vrpSolutionView.Size = new System.Drawing.Size(476, 223); 130 143 this.vrpSolutionView.TabIndex = 0; 131 144 // … … 133 146 // 134 147 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 148 this.Controls.Add(this.importBestButton); 135 149 this.Controls.Add(this.importButton3); 136 150 this.Controls.Add(this.importButton2); … … 138 152 this.Controls.Add(this.tabControl1); 139 153 this.Name = "VehicleRoutingProblemView"; 140 this.Size = new System.Drawing.Size(490, 3 52);154 this.Size = new System.Drawing.Size(490, 369); 141 155 this.Controls.SetChildIndex(this.tabControl1, 0); 142 156 this.Controls.SetChildIndex(this.importButton, 0); … … 147 161 this.Controls.SetChildIndex(this.importButton2, 0); 148 162 this.Controls.SetChildIndex(this.importButton3, 0); 163 this.Controls.SetChildIndex(this.importBestButton, 0); 149 164 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 150 165 this.tabControl1.ResumeLayout(false); … … 166 181 private System.Windows.Forms.Button importButton2; 167 182 private System.Windows.Forms.Button importButton3; 183 private System.Windows.Forms.Button importBestButton; 168 184 } 169 185 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.cs
r4352 r4619 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.Core; 28 using HeuristicLab.Data; 29 using HeuristicLab.Parameters; 28 30 29 31 namespace HeuristicLab.Problems.VehicleRouting.Views { … … 42 44 protected override void DeregisterContentEvents() { 43 45 Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged); 46 Content.BestKnownQualityParameter.ValueChanged -= new EventHandler(BestKnownQualityParameter_ValueChanged); 44 47 base.DeregisterContentEvents(); 45 48 } … … 47 50 base.RegisterContentEvents(); 48 51 Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged); 52 Content.BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged); 49 53 } 50 54 … … 56 60 } else { 57 61 parameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters; 58 vrpSolutionView.Content = new VRPSolution(Content.Coordinates);62 UpdateSolution(); 59 63 } 60 64 } … … 64 68 parameterCollectionView.Enabled = Content != null; 65 69 vrpSolutionView.Enabled = Content != null; 66 importB utton.Enabled = importButton2.Enabled = importButton3.Enabled = Content != null && !ReadOnly;70 importBestButton.Enabled = importButton.Enabled = importButton2.Enabled = importButton3.Enabled = Content != null && !ReadOnly; 67 71 } 68 72 … … 85 89 } 86 90 91 private void importBestButton_Click(object sender, EventArgs e) { 92 OpenFileDialog dialog = new OpenFileDialog(); 93 dialog.Filter = "VRP solution files (*.opt)|*.opt"; 94 95 if (dialog.ShowDialog() == DialogResult.OK) { 96 Content.ImportSolution(dialog.FileName); 97 } 98 } 99 87 100 private void importButton3_Click(object sender, EventArgs e) { 88 101 OpenFileDialog dialog = new OpenFileDialog(); … … 96 109 private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) { 97 110 vrpSolutionView.Content.Coordinates = Content.Coordinates; 98 } 111 } 112 113 private void UpdateSolution() { 114 if (Content.BestKnownSolution == null) 115 vrpSolutionView.Content = new VRPSolution(Content.Coordinates); 116 else { 117 //call evaluator 118 IValueLookupParameter<DoubleMatrix> distMatrix = new ValueLookupParameter<DoubleMatrix>("DistMatrix", 119 Content.DistanceMatrix); 120 121 TourEvaluation eval = VRPEvaluator.Evaluate( 122 Content.BestKnownSolution, 123 Content.Vehicles, 124 Content.DueTime, 125 Content.ServiceTime, 126 Content.ReadyTime, 127 Content.Demand, 128 Content.Capacity, 129 Content.FleetUsageFactorParameter.Value, 130 Content.TimeFactorParameter.Value, 131 Content.DistanceFactorParameter.Value, 132 Content.OverloadPenaltyParameter.Value, 133 Content.TardinessPenaltyParameter.Value, 134 Content.Coordinates, 135 distMatrix, 136 Content.UseDistanceMatrix); 137 138 Content.DistanceMatrix = distMatrix.Value; 139 140 vrpSolutionView.Content = new VRPSolution(Content.Coordinates, 141 Content.BestKnownSolution, 142 new DoubleValue(eval.Quality), 143 new DoubleValue(eval.Distance), 144 new DoubleValue(eval.Overload), 145 new DoubleValue(eval.Tardiness), 146 new DoubleValue(eval.TravelTime), 147 new DoubleValue(eval.VehcilesUtilized), 148 Content.DistanceMatrix, 149 Content.UseDistanceMatrix, 150 Content.ReadyTime, 151 Content.DueTime, 152 Content.ServiceTime); 153 } 154 } 155 156 void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) { 157 UpdateSolution(); 158 } 99 159 } 100 160 }
Note: See TracChangeset
for help on using the changeset viewer.