Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/31/17 17:45:48 (7 years ago)
Author:
jkarder
Message:

#2205: worked on optimization networks

  • fixed bugs in ttp network/orchestrator 3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3/TtpOrchestratorNode3.cs

    r14628 r14629  
    2727using HeuristicLab.Data;
    2828using HeuristicLab.Encodings.BinaryVectorEncoding;
    29 using HeuristicLab.Encodings.PermutationEncoding;
    3029using HeuristicLab.Encodings.RealVectorEncoding;
    3130using HeuristicLab.Optimization;
     
    101100      var tspMsg = TspSolverOrchestrationPort.PrepareMessage();
    102101      tspMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(OrchestrationMessage.Prepare | OrchestrationMessage.ClearRuns | OrchestrationMessage.Start);
    103       var tpp = new TourProfitProblem {
    104         Tsp = (TravelingSalesmanProblem)TspParameter.Value.Clone(),
    105         Ksp = (BinaryKnapsackProblem)KspParameter.Value.Clone(),
    106         FixedKspSolution = bestKspSolution,
    107         Availability = AvailabilityParameter.Value.ToArray(),
    108         RentingRatio = RentingRatioParameter.Value.Value,
    109         MinSpeed = MinSpeedParameter.Value.Value,
    110         MaxSpeed = MaxSpeedParameter.Value.Value,
    111         DistanceType = distanceType
    112       };
    113       tpp.Encoding.Length = TspParameter.Value.Coordinates.Rows;
    114       tspMsg["Problem"] = tpp;
     102      tspMsg["Problem"] = tsp;
    115103      TspSolverOrchestrationPort.SendMessage(tspMsg);
    116104      cts.Token.ThrowIfCancellationRequested();
    117105
    118106      var tspResults = (ResultCollection)tspMsg["Results"];
    119       var bestTspSolution = (Permutation)tspResults["Best TSP Solution"].Value.Clone();
     107      var bestTspSolution = (PathTSPTour)tspResults["Best TSP Solution"].Value.Clone();
    120108      var coordinates = (DoubleMatrix)TspParameter.Value.Coordinates.Clone();
    121       var tour = new PathTSPTour(coordinates, bestTspSolution, new DoubleValue(TSPCoordinatesPathEvaluator.Apply(new TSPEuclideanPathEvaluator(), coordinates, bestTspSolution)));
     109      var tour = new PathTSPTour(coordinates, bestTspSolution.Permutation, new DoubleValue(TSPCoordinatesPathEvaluator.Apply(new TSPEuclideanPathEvaluator(), coordinates, bestTspSolution.Permutation)));
    122110
    123111      #region Analyze
Note: See TracChangeset for help on using the changeset viewer.