- Timestamp:
- 01/31/17 17:45:48 (8 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3/Problems/LootProfitProblem.cs
r14610 r14629 79 79 public override double Evaluate(BinaryVector vector, IRandom random) { 80 80 return TtpUtils.Evaluate(Tsp, FixedTspSolution.ToArray(), 81 82 81 Ksp, vector.ToArray(), 82 Availability, RentingRatio, MinSpeed, MaxSpeed, DistanceType); 83 83 } 84 84 -
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3/Problems/TourProfitProblem.cs
r14604 r14629 78 78 public override double Evaluate(Individual individual, IRandom random) { 79 79 return TtpUtils.Evaluate(Tsp, individual.Permutation().ToArray(), 80 81 80 Ksp, FixedKspSolution.ToArray(), 81 Availability, RentingRatio, MinSpeed, MaxSpeed, DistanceType); 82 82 } 83 83 -
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3/TtpNetwork3.cs
r14628 r14629 38 38 public TtpNetwork3() : this("TtpNetwork3") { } 39 39 public TtpNetwork3(string name) : base(name) { 40 Orchestrator = new TtpOrchestratorNode 2(OrchestratorNodeName);40 Orchestrator = new TtpOrchestratorNode3(OrchestratorNodeName); 41 41 MetaSolver = new OrchestratedAlgorithmNode(MetaSolverNodeName); 42 42 TspSolver = new OrchestratedAlgorithmNode(TspSolverNodeName); -
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3/TtpOrchestratorNode3.cs
r14628 r14629 27 27 using HeuristicLab.Data; 28 28 using HeuristicLab.Encodings.BinaryVectorEncoding; 29 using HeuristicLab.Encodings.PermutationEncoding;30 29 using HeuristicLab.Encodings.RealVectorEncoding; 31 30 using HeuristicLab.Optimization; … … 101 100 var tspMsg = TspSolverOrchestrationPort.PrepareMessage(); 102 101 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; 115 103 TspSolverOrchestrationPort.SendMessage(tspMsg); 116 104 cts.Token.ThrowIfCancellationRequested(); 117 105 118 106 var tspResults = (ResultCollection)tspMsg["Results"]; 119 var bestTspSolution = (P ermutation)tspResults["Best TSP Solution"].Value.Clone();107 var bestTspSolution = (PathTSPTour)tspResults["Best TSP Solution"].Value.Clone(); 120 108 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))); 122 110 123 111 #region Analyze
Note: See TracChangeset
for help on using the changeset viewer.