Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/25/17 15:57:45 (6 years ago)
Author:
jkarder
Message:

#2205: worked on optimization networks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.LocationRouting/3.3/LrpOrchestratorNode1.cs

    r14605 r14606  
    298298
    299299      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)) {
    302302        var depotIdx = depot.Key;
    303303        var customers = depot.ToArray();
     
    319319
    320320        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));
    322322      }
    323323
    324324      #region Analyze
    325       double objectiveValue = LrpUtils.Evaluate(flpSolution, vrpSolutions.Values.ToArray());
     325      double objectiveValue = LrpUtils.Evaluate(flpSolution, vrpSolutions.Select(x => (VRPSolution)x.Value).ToArray());
    326326      ((DoubleValue)message["Quality"]).Value = objectiveValue;
    327327
     
    329329      if (!Results.TryGetValue("Best LRP Quality", out bestQuality)) {
    330330        Results.Add(new Result("Best LRP Quality", new DoubleValue(objectiveValue)));
    331         Results.Add(new Result("Best FLP", flpSolution));
    332         Results.Add(new Result("Best VRPs", vrpSolutions));
     331        Results.Add(new Result("Best FLP Solution", flpSolution));
     332        Results.Add(new Result("Best VRP Solutions", vrpSolutions));
    333333      } else if (objectiveValue < ((DoubleValue)bestQuality.Value).Value) {
    334334        ((DoubleValue)bestQuality.Value).Value = objectiveValue;
    335         Results["Best FLP"].Value = flpSolution;
    336         Results["Best VRPs"].Value = vrpSolutions;
     335        Results["Best FLP Solution"].Value = flpSolution;
     336        Results["Best VRP Solutions"].Value = vrpSolutions;
    337337      }
    338338      #endregion
Note: See TracChangeset for help on using the changeset viewer.