- Timestamp:
- 01/25/17 15:57:45 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.LocationRouting/3.3/LrpOrchestratorNode1.cs
r14605 r14606 298 298 299 299 var depots = bestFlpSolution.Select((x, i) => Tuple.Create(x, i)).GroupBy(x => x.Item1, x => x.Item2); 300 var vrpSolutions = new ItemDictionary<IntValue, VRPSolution>();301 foreach (var depot in depots ) {300 var vrpSolutions = new ResultCollection(depots.Count()); 301 foreach (var depot in depots.OrderBy(x => x.Key)) { 302 302 var depotIdx = depot.Key; 303 303 var customers = depot.ToArray(); … … 319 319 320 320 var bestVrpSolution = (VRPSolution)vrpResults["Best valid VRP Solution"].Value.Clone(); 321 vrpSolutions.Add(new IntValue(depot.Key), bestVrpSolution);321 vrpSolutions.Add(new Result("Depot " + depot.Key, bestVrpSolution)); 322 322 } 323 323 324 324 #region Analyze 325 double objectiveValue = LrpUtils.Evaluate(flpSolution, vrpSolutions. Values.ToArray());325 double objectiveValue = LrpUtils.Evaluate(flpSolution, vrpSolutions.Select(x => (VRPSolution)x.Value).ToArray()); 326 326 ((DoubleValue)message["Quality"]).Value = objectiveValue; 327 327 … … 329 329 if (!Results.TryGetValue("Best LRP Quality", out bestQuality)) { 330 330 Results.Add(new Result("Best LRP Quality", new DoubleValue(objectiveValue))); 331 Results.Add(new Result("Best FLP ", flpSolution));332 Results.Add(new Result("Best VRP s", vrpSolutions));331 Results.Add(new Result("Best FLP Solution", flpSolution)); 332 Results.Add(new Result("Best VRP Solutions", vrpSolutions)); 333 333 } else if (objectiveValue < ((DoubleValue)bestQuality.Value).Value) { 334 334 ((DoubleValue)bestQuality.Value).Value = objectiveValue; 335 Results["Best FLP "].Value = flpSolution;336 Results["Best VRP s"].Value = vrpSolutions;335 Results["Best FLP Solution"].Value = flpSolution; 336 Results["Best VRP Solutions"].Value = vrpSolutions; 337 337 } 338 338 #endregion
Note: See TracChangeset
for help on using the changeset viewer.