1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System;
|
---|
23 | using HeuristicLab.Analysis;
|
---|
24 | using HeuristicLab.Common;
|
---|
25 | using HeuristicLab.Core;
|
---|
26 | using HeuristicLab.Data;
|
---|
27 | using HeuristicLab.Operators;
|
---|
28 | using HeuristicLab.Optimization;
|
---|
29 | using HeuristicLab.Optimization.Operators;
|
---|
30 | using HeuristicLab.Parameters;
|
---|
31 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
32 |
|
---|
33 | namespace HeuristicLab.Problems.VehicleRouting {
|
---|
34 | /// <summary>
|
---|
35 | /// An operator which analyzes the best, average and worst quality of solutions in the scope tree.
|
---|
36 | /// </summary>
|
---|
37 | [Item("BestAverageWorstVRPToursAnalyzer", "An operator which analyzes the best, average and worst properties of the VRP tours in the scope tree.")]
|
---|
38 | [StorableClass]
|
---|
39 | public sealed class BestAverageWorstVRPToursAnalyzer : AlgorithmOperator, IAnalyzer {
|
---|
40 | #region Parameter properties
|
---|
41 | public ScopeTreeLookupParameter<DoubleValue> OverloadParameter {
|
---|
42 | get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Overload"]; }
|
---|
43 | }
|
---|
44 | public ValueLookupParameter<DoubleValue> BestOverloadParameter {
|
---|
45 | get { return (ValueLookupParameter<DoubleValue>)Parameters["BestOverload"]; }
|
---|
46 | }
|
---|
47 | public ValueLookupParameter<DoubleValue> CurrentBestOverloadParameter {
|
---|
48 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentBestOverload"]; }
|
---|
49 | }
|
---|
50 | public ValueLookupParameter<DoubleValue> CurrentAverageOverloadParameter {
|
---|
51 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentAverageOverload"]; }
|
---|
52 | }
|
---|
53 | public ValueLookupParameter<DoubleValue> CurrentWorstOverloadParameter {
|
---|
54 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentWorstOverload"]; }
|
---|
55 | }
|
---|
56 | public ValueLookupParameter<DataTable> OverloadsParameter {
|
---|
57 | get { return (ValueLookupParameter<DataTable>)Parameters["Overloads"]; }
|
---|
58 | }
|
---|
59 |
|
---|
60 | public ScopeTreeLookupParameter<DoubleValue> TardinessParameter {
|
---|
61 | get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Tardiness"]; }
|
---|
62 | }
|
---|
63 | public ValueLookupParameter<DoubleValue> BestTardinessParameter {
|
---|
64 | get { return (ValueLookupParameter<DoubleValue>)Parameters["BestTardiness"]; }
|
---|
65 | }
|
---|
66 | public ValueLookupParameter<DoubleValue> CurrentBestTardinessParameter {
|
---|
67 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentBestTardiness"]; }
|
---|
68 | }
|
---|
69 | public ValueLookupParameter<DoubleValue> CurrentAverageTardinessParameter {
|
---|
70 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentAverageTardiness"]; }
|
---|
71 | }
|
---|
72 | public ValueLookupParameter<DoubleValue> CurrentWorstTardinessParameter {
|
---|
73 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentWorstTardiness"]; }
|
---|
74 | }
|
---|
75 | public ValueLookupParameter<DataTable> TardinessValuesParameter {
|
---|
76 | get { return (ValueLookupParameter<DataTable>)Parameters["TardinessValues"]; }
|
---|
77 | }
|
---|
78 |
|
---|
79 | public ScopeTreeLookupParameter<DoubleValue> DistanceParameter {
|
---|
80 | get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Distance"]; }
|
---|
81 | }
|
---|
82 | public ValueLookupParameter<DoubleValue> BestDistanceParameter {
|
---|
83 | get { return (ValueLookupParameter<DoubleValue>)Parameters["BestDistance"]; }
|
---|
84 | }
|
---|
85 | public ValueLookupParameter<DoubleValue> CurrentBestDistanceParameter {
|
---|
86 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentBestDistance"]; }
|
---|
87 | }
|
---|
88 | public ValueLookupParameter<DoubleValue> CurrentAverageDistanceParameter {
|
---|
89 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentAverageDistance"]; }
|
---|
90 | }
|
---|
91 | public ValueLookupParameter<DoubleValue> CurrentWorstDistanceParameter {
|
---|
92 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentWorstDistance"]; }
|
---|
93 | }
|
---|
94 | public ValueLookupParameter<DataTable> DistancesParameter {
|
---|
95 | get { return (ValueLookupParameter<DataTable>)Parameters["Distances"]; }
|
---|
96 | }
|
---|
97 |
|
---|
98 | public ScopeTreeLookupParameter<DoubleValue> TravelTimeParameter {
|
---|
99 | get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["TravelTime"]; }
|
---|
100 | }
|
---|
101 | public ValueLookupParameter<DoubleValue> BestTravelTimeParameter {
|
---|
102 | get { return (ValueLookupParameter<DoubleValue>)Parameters["BestTravelTime"]; }
|
---|
103 | }
|
---|
104 | public ValueLookupParameter<DoubleValue> CurrentBestTravelTimeParameter {
|
---|
105 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentBestTravelTime"]; }
|
---|
106 | }
|
---|
107 | public ValueLookupParameter<DoubleValue> CurrentAverageTravelTimeParameter {
|
---|
108 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentAverageTravelTime"]; }
|
---|
109 | }
|
---|
110 | public ValueLookupParameter<DoubleValue> CurrentWorstTravelTimeParameter {
|
---|
111 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentWorstTravelTime"]; }
|
---|
112 | }
|
---|
113 | public ValueLookupParameter<DataTable> TravelTimesParameter {
|
---|
114 | get { return (ValueLookupParameter<DataTable>)Parameters["TravelTimes"]; }
|
---|
115 | }
|
---|
116 |
|
---|
117 | public ScopeTreeLookupParameter<DoubleValue> VehiclesUtilizedParameter {
|
---|
118 | get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["VehiclesUtilized"]; }
|
---|
119 | }
|
---|
120 | public ValueLookupParameter<DoubleValue> BestVehiclesUtilizedParameter {
|
---|
121 | get { return (ValueLookupParameter<DoubleValue>)Parameters["BestVehiclesUtilized"]; }
|
---|
122 | }
|
---|
123 | public ValueLookupParameter<DoubleValue> CurrentBestVehiclesUtilizedParameter {
|
---|
124 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentBestVehiclesUtilized"]; }
|
---|
125 | }
|
---|
126 | public ValueLookupParameter<DoubleValue> CurrentAverageVehiclesUtilizedParameter {
|
---|
127 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentAverageVehiclesUtilized"]; }
|
---|
128 | }
|
---|
129 | public ValueLookupParameter<DoubleValue> CurrentWorstVehiclesUtilizedParameter {
|
---|
130 | get { return (ValueLookupParameter<DoubleValue>)Parameters["CurrentWorstVehiclesUtilized"]; }
|
---|
131 | }
|
---|
132 | public ValueLookupParameter<DataTable> VehiclesUtilizedValuesParameter {
|
---|
133 | get { return (ValueLookupParameter<DataTable>)Parameters["VehiclesUtilizedValues"]; }
|
---|
134 | }
|
---|
135 |
|
---|
136 | public ValueLookupParameter<VariableCollection> ResultsParameter {
|
---|
137 | get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
|
---|
138 | }
|
---|
139 | #endregion
|
---|
140 |
|
---|
141 | #region Properties
|
---|
142 | private BestVRPToursMemorizer BestMemorizer {
|
---|
143 | get { return (BestVRPToursMemorizer)OperatorGraph.InitialOperator; }
|
---|
144 | }
|
---|
145 | private BestAverageWorstVRPToursCalculator BestAverageWorstCalculator {
|
---|
146 | get { return (BestAverageWorstVRPToursCalculator)BestMemorizer.Successor; }
|
---|
147 | }
|
---|
148 | #endregion
|
---|
149 |
|
---|
150 | public BestAverageWorstVRPToursAnalyzer()
|
---|
151 | : base() {
|
---|
152 | #region Create parameters
|
---|
153 | Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Overload", "The overloads of the VRP solutions which should be analyzed."));
|
---|
154 | Parameters.Add(new ValueLookupParameter<DoubleValue>("BestOverload", "The best overload value."));
|
---|
155 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentBestOverload", "The current best overload value."));
|
---|
156 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentAverageOverload", "The current average overload value of all solutions."));
|
---|
157 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentWorstOverload", "The current worst overload value of all solutions."));
|
---|
158 | Parameters.Add(new ValueLookupParameter<DataTable>("Overloads", "The data table to store the current best, current average, current worst, best and best known overload value."));
|
---|
159 |
|
---|
160 | Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Tardiness", "The tardiness of the VRP solutions which should be analyzed."));
|
---|
161 | Parameters.Add(new ValueLookupParameter<DoubleValue>("BestTardiness", "The best tardiness value."));
|
---|
162 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentBestTardiness", "The current best tardiness value."));
|
---|
163 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentAverageTardiness", "The current average tardiness value of all solutions."));
|
---|
164 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentWorstTardiness", "The current worst tardiness value of all solutions."));
|
---|
165 | Parameters.Add(new ValueLookupParameter<DataTable>("TardinessValues", "The data table to store the current best, current average, current worst, best and best known tardiness value."));
|
---|
166 |
|
---|
167 | Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Distance", "The distance of the VRP solutions which should be analyzed."));
|
---|
168 | Parameters.Add(new ValueLookupParameter<DoubleValue>("BestDistance", "The best distance value."));
|
---|
169 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentBestDistance", "The current best distance value."));
|
---|
170 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentAverageDistance", "The current average distance value of all solutions."));
|
---|
171 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentWorstDistance", "The current worst distance value of all solutions."));
|
---|
172 | Parameters.Add(new ValueLookupParameter<DataTable>("Distances", "The data table to store the current best, current average, current worst, best and best known distance value."));
|
---|
173 |
|
---|
174 | Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("TravelTime", "The travel time of the VRP solutions which should be analyzed."));
|
---|
175 | Parameters.Add(new ValueLookupParameter<DoubleValue>("BestTravelTime", "The best travel time value."));
|
---|
176 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentBestTravelTime", "The current best travel time value."));
|
---|
177 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentAverageTravelTime", "The current average travel time value of all solutions."));
|
---|
178 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentWorstTravelTime", "The current worst travel time value of all solutions."));
|
---|
179 | Parameters.Add(new ValueLookupParameter<DataTable>("TravelTimes", "The data table to store the current best, current average, current worst, best and best known travel time value."));
|
---|
180 |
|
---|
181 | Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("VehiclesUtilized", "The vehicles utilized of the VRP solutions which should be analyzed."));
|
---|
182 | Parameters.Add(new ValueLookupParameter<DoubleValue>("BestVehiclesUtilized", "The best vehicles utilized value."));
|
---|
183 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentBestVehiclesUtilized", "The current best vehicles utilized value."));
|
---|
184 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentAverageVehiclesUtilized", "The current average vehicles utilized value of all solutions."));
|
---|
185 | Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentWorstVehiclesUtilized", "The current worst vehicles utilized value of all solutions."));
|
---|
186 | Parameters.Add(new ValueLookupParameter<DataTable>("VehiclesUtilizedValues", "The data table to store the current best, current average, current worst, best and best known vehicles utilized value."));
|
---|
187 |
|
---|
188 | Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The results collection where the analysis values should be stored."));
|
---|
189 | #endregion
|
---|
190 |
|
---|
191 | #region Create operators
|
---|
192 | BestVRPToursMemorizer bestMemorizer = new BestVRPToursMemorizer();
|
---|
193 | BestAverageWorstVRPToursCalculator calculator = new BestAverageWorstVRPToursCalculator();
|
---|
194 | ResultsCollector resultsCollector = new ResultsCollector();
|
---|
195 |
|
---|
196 | //overload
|
---|
197 | bestMemorizer.BestOverloadParameter.ActualName = BestOverloadParameter.Name;
|
---|
198 | bestMemorizer.OverloadParameter.ActualName = OverloadParameter.Name;
|
---|
199 | bestMemorizer.OverloadParameter.Depth = OverloadParameter.Depth;
|
---|
200 |
|
---|
201 | calculator.OverloadParameter.ActualName = OverloadParameter.Name;
|
---|
202 | calculator.OverloadParameter.Depth = OverloadParameter.Depth;
|
---|
203 | calculator.BestOverloadParameter.ActualName = CurrentBestOverloadParameter.Name;
|
---|
204 | calculator.AverageOverloadParameter.ActualName = CurrentAverageOverloadParameter.Name;
|
---|
205 | calculator.WorstOverloadParameter.ActualName = CurrentWorstOverloadParameter.Name;
|
---|
206 |
|
---|
207 | DataTableValuesCollector overloadDataTablesCollector = new DataTableValuesCollector();
|
---|
208 | overloadDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("BestOverload", null, BestOverloadParameter.Name));
|
---|
209 | overloadDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentBestOverload", null, CurrentBestOverloadParameter.Name));
|
---|
210 | overloadDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentAverageOverload", null, CurrentAverageOverloadParameter.Name));
|
---|
211 | overloadDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentWorstOverload", null, CurrentWorstOverloadParameter.Name));
|
---|
212 | overloadDataTablesCollector.DataTableParameter.ActualName = OverloadsParameter.Name;
|
---|
213 |
|
---|
214 | resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(OverloadsParameter.Name));
|
---|
215 |
|
---|
216 | //tardiness
|
---|
217 | bestMemorizer.BestTardinessParameter.ActualName = BestTardinessParameter.Name;
|
---|
218 | bestMemorizer.TardinessParameter.ActualName = TardinessParameter.Name;
|
---|
219 | bestMemorizer.TardinessParameter.Depth = TardinessParameter.Depth;
|
---|
220 |
|
---|
221 | calculator.TardinessParameter.ActualName = TardinessParameter.Name;
|
---|
222 | calculator.TardinessParameter.Depth = TardinessParameter.Depth;
|
---|
223 | calculator.BestTardinessParameter.ActualName = CurrentBestTardinessParameter.Name;
|
---|
224 | calculator.AverageTardinessParameter.ActualName = CurrentAverageTardinessParameter.Name;
|
---|
225 | calculator.WorstTardinessParameter.ActualName = CurrentWorstTardinessParameter.Name;
|
---|
226 |
|
---|
227 | DataTableValuesCollector tardinessDataTablesCollector = new DataTableValuesCollector();
|
---|
228 | tardinessDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("BestTardiness", null, BestTardinessParameter.Name));
|
---|
229 | tardinessDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentBestTardiness", null, CurrentBestTardinessParameter.Name));
|
---|
230 | tardinessDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentAverageTardiness", null, CurrentAverageTardinessParameter.Name));
|
---|
231 | tardinessDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentWorstTardiness", null, CurrentWorstTardinessParameter.Name));
|
---|
232 | tardinessDataTablesCollector.DataTableParameter.ActualName = TardinessValuesParameter.Name;
|
---|
233 |
|
---|
234 | resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(TardinessValuesParameter.Name));
|
---|
235 |
|
---|
236 | //Distance
|
---|
237 | bestMemorizer.BestDistanceParameter.ActualName = BestDistanceParameter.Name;
|
---|
238 | bestMemorizer.DistanceParameter.ActualName = DistanceParameter.Name;
|
---|
239 | bestMemorizer.DistanceParameter.Depth = DistanceParameter.Depth;
|
---|
240 |
|
---|
241 | calculator.DistanceParameter.ActualName = DistanceParameter.Name;
|
---|
242 | calculator.DistanceParameter.Depth = DistanceParameter.Depth;
|
---|
243 | calculator.BestDistanceParameter.ActualName = CurrentBestDistanceParameter.Name;
|
---|
244 | calculator.AverageDistanceParameter.ActualName = CurrentAverageDistanceParameter.Name;
|
---|
245 | calculator.WorstDistanceParameter.ActualName = CurrentWorstDistanceParameter.Name;
|
---|
246 |
|
---|
247 | DataTableValuesCollector distanceDataTablesCollector = new DataTableValuesCollector();
|
---|
248 | distanceDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("BestDistance", null, BestDistanceParameter.Name));
|
---|
249 | distanceDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentBestDistance", null, CurrentBestDistanceParameter.Name));
|
---|
250 | distanceDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentAverageDistance", null, CurrentAverageDistanceParameter.Name));
|
---|
251 | distanceDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentWorstDistance", null, CurrentWorstDistanceParameter.Name));
|
---|
252 | distanceDataTablesCollector.DataTableParameter.ActualName = DistancesParameter.Name;
|
---|
253 |
|
---|
254 | resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(DistancesParameter.Name));
|
---|
255 |
|
---|
256 | //Travel Time
|
---|
257 | bestMemorizer.BestTravelTimeParameter.ActualName = BestTravelTimeParameter.Name;
|
---|
258 | bestMemorizer.TravelTimeParameter.ActualName = TravelTimeParameter.Name;
|
---|
259 | bestMemorizer.TravelTimeParameter.Depth = TravelTimeParameter.Depth;
|
---|
260 |
|
---|
261 | calculator.TravelTimeParameter.ActualName = TravelTimeParameter.Name;
|
---|
262 | calculator.TravelTimeParameter.Depth = TravelTimeParameter.Depth;
|
---|
263 | calculator.BestTravelTimeParameter.ActualName = CurrentBestTravelTimeParameter.Name;
|
---|
264 | calculator.AverageTravelTimeParameter.ActualName = CurrentAverageTravelTimeParameter.Name;
|
---|
265 | calculator.WorstTravelTimeParameter.ActualName = CurrentWorstTravelTimeParameter.Name;
|
---|
266 |
|
---|
267 | DataTableValuesCollector travelTimeDataTablesCollector = new DataTableValuesCollector();
|
---|
268 | travelTimeDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("BestTravelTime", null, BestTravelTimeParameter.Name));
|
---|
269 | travelTimeDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentBestTravelTime", null, CurrentBestTravelTimeParameter.Name));
|
---|
270 | travelTimeDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentAverageTravelTime", null, CurrentAverageTravelTimeParameter.Name));
|
---|
271 | travelTimeDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentWorstTravelTime", null, CurrentWorstTravelTimeParameter.Name));
|
---|
272 | travelTimeDataTablesCollector.DataTableParameter.ActualName = TravelTimesParameter.Name;
|
---|
273 |
|
---|
274 | resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(TravelTimesParameter.Name));
|
---|
275 |
|
---|
276 | //Vehicles Utlized
|
---|
277 | bestMemorizer.BestVehiclesUtilizedParameter.ActualName = BestVehiclesUtilizedParameter.Name;
|
---|
278 | bestMemorizer.VehiclesUtilizedParameter.ActualName = VehiclesUtilizedParameter.Name;
|
---|
279 | bestMemorizer.VehiclesUtilizedParameter.Depth = VehiclesUtilizedParameter.Depth;
|
---|
280 |
|
---|
281 | calculator.VehiclesUtilizedParameter.ActualName = VehiclesUtilizedParameter.Name;
|
---|
282 | calculator.VehiclesUtilizedParameter.Depth = VehiclesUtilizedParameter.Depth;
|
---|
283 | calculator.BestVehiclesUtilizedParameter.ActualName = CurrentBestVehiclesUtilizedParameter.Name;
|
---|
284 | calculator.AverageVehiclesUtilizedParameter.ActualName = CurrentAverageVehiclesUtilizedParameter.Name;
|
---|
285 | calculator.WorstVehiclesUtilizedParameter.ActualName = CurrentWorstVehiclesUtilizedParameter.Name;
|
---|
286 |
|
---|
287 | DataTableValuesCollector vehiclesUtilizedDataTablesCollector = new DataTableValuesCollector();
|
---|
288 | vehiclesUtilizedDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("BestVehiclesUtilized", null, BestVehiclesUtilizedParameter.Name));
|
---|
289 | vehiclesUtilizedDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentBestVehiclesUtilized", null, CurrentBestVehiclesUtilizedParameter.Name));
|
---|
290 | vehiclesUtilizedDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentAverageVehiclesUtilized", null, CurrentAverageVehiclesUtilizedParameter.Name));
|
---|
291 | vehiclesUtilizedDataTablesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentWorstVehiclesUtilized", null, CurrentWorstVehiclesUtilizedParameter.Name));
|
---|
292 | vehiclesUtilizedDataTablesCollector.DataTableParameter.ActualName = VehiclesUtilizedValuesParameter.Name;
|
---|
293 |
|
---|
294 | resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(VehiclesUtilizedValuesParameter.Name));
|
---|
295 | #endregion
|
---|
296 |
|
---|
297 | #region Create operator graph
|
---|
298 | OperatorGraph.InitialOperator = bestMemorizer;
|
---|
299 | bestMemorizer.Successor = calculator;
|
---|
300 | calculator.Successor = overloadDataTablesCollector;
|
---|
301 | overloadDataTablesCollector.Successor = tardinessDataTablesCollector;
|
---|
302 | tardinessDataTablesCollector.Successor = distanceDataTablesCollector;
|
---|
303 | distanceDataTablesCollector.Successor = travelTimeDataTablesCollector;
|
---|
304 | travelTimeDataTablesCollector.Successor = vehiclesUtilizedDataTablesCollector;
|
---|
305 | vehiclesUtilizedDataTablesCollector.Successor = resultsCollector;
|
---|
306 | resultsCollector.Successor = null;
|
---|
307 | #endregion
|
---|
308 |
|
---|
309 | Initialize();
|
---|
310 | }
|
---|
311 | [StorableConstructor]
|
---|
312 | private BestAverageWorstVRPToursAnalyzer(bool deserializing) : base() { }
|
---|
313 | private BestAverageWorstVRPToursAnalyzer(BestAverageWorstVRPToursAnalyzer original, Cloner cloner)
|
---|
314 | : base(original, cloner) {
|
---|
315 | Initialize();
|
---|
316 | }
|
---|
317 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
318 | return new BestAverageWorstVRPToursAnalyzer(this, cloner);
|
---|
319 | }
|
---|
320 |
|
---|
321 | [StorableHook(HookType.AfterDeserialization)]
|
---|
322 | private void AfterDeserialization() {
|
---|
323 | Initialize();
|
---|
324 | }
|
---|
325 | private void Initialize() {
|
---|
326 | OverloadParameter.DepthChanged += new EventHandler(OverloadParameter_DepthChanged);
|
---|
327 | TardinessParameter.DepthChanged += new EventHandler(TardinessParameter_DepthChanged);
|
---|
328 | DistanceParameter.DepthChanged += new EventHandler(DistanceParameter_DepthChanged);
|
---|
329 | TravelTimeParameter.DepthChanged += new EventHandler(TravelTimeParameter_DepthChanged);
|
---|
330 | VehiclesUtilizedParameter.DepthChanged += new EventHandler(VehiclesUtilizedParameter_DepthChanged);
|
---|
331 | }
|
---|
332 |
|
---|
333 |
|
---|
334 | void OverloadParameter_DepthChanged(object sender, EventArgs e) {
|
---|
335 | BestAverageWorstCalculator.OverloadParameter.Depth = OverloadParameter.Depth;
|
---|
336 | BestMemorizer.OverloadParameter.Depth = OverloadParameter.Depth;
|
---|
337 | }
|
---|
338 |
|
---|
339 | void TardinessParameter_DepthChanged(object sender, EventArgs e) {
|
---|
340 | BestAverageWorstCalculator.TardinessParameter.Depth = TardinessParameter.Depth;
|
---|
341 | BestMemorizer.TardinessParameter.Depth = TardinessParameter.Depth;
|
---|
342 | }
|
---|
343 |
|
---|
344 | void DistanceParameter_DepthChanged(object sender, EventArgs e) {
|
---|
345 | BestAverageWorstCalculator.DistanceParameter.Depth = DistanceParameter.Depth;
|
---|
346 | BestMemorizer.DistanceParameter.Depth = DistanceParameter.Depth;
|
---|
347 | }
|
---|
348 |
|
---|
349 | void TravelTimeParameter_DepthChanged(object sender, EventArgs e) {
|
---|
350 | BestAverageWorstCalculator.TravelTimeParameter.Depth = TravelTimeParameter.Depth;
|
---|
351 | BestMemorizer.TravelTimeParameter.Depth = DistanceParameter.Depth;
|
---|
352 | }
|
---|
353 |
|
---|
354 | void VehiclesUtilizedParameter_DepthChanged(object sender, EventArgs e) {
|
---|
355 | BestAverageWorstCalculator.VehiclesUtilizedParameter.Depth = VehiclesUtilizedParameter.Depth;
|
---|
356 | BestMemorizer.VehiclesUtilizedParameter.Depth = VehiclesUtilizedParameter.Depth;
|
---|
357 | }
|
---|
358 | }
|
---|
359 | }
|
---|