Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14629


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

#2205: worked on optimization networks

  • fixed bugs in ttp network/orchestrator 3
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  
    7979    public override double Evaluate(BinaryVector vector, IRandom random) {
    8080      return TtpUtils.Evaluate(Tsp, FixedTspSolution.ToArray(),
    81                                   Ksp, vector.ToArray(),
    82                                   Availability, RentingRatio, MinSpeed, MaxSpeed, DistanceType);
     81                               Ksp, vector.ToArray(),
     82                               Availability, RentingRatio, MinSpeed, MaxSpeed, DistanceType);
    8383    }
    8484
  • branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3/Problems/TourProfitProblem.cs

    r14604 r14629  
    7878    public override double Evaluate(Individual individual, IRandom random) {
    7979      return TtpUtils.Evaluate(Tsp, individual.Permutation().ToArray(),
    80                                   Ksp, FixedKspSolution.ToArray(),
    81                                   Availability, RentingRatio, MinSpeed, MaxSpeed, DistanceType);
     80                               Ksp, FixedKspSolution.ToArray(),
     81                               Availability, RentingRatio, MinSpeed, MaxSpeed, DistanceType);
    8282    }
    8383
  • branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3/TtpNetwork3.cs

    r14628 r14629  
    3838    public TtpNetwork3() : this("TtpNetwork3") { }
    3939    public TtpNetwork3(string name) : base(name) {
    40       Orchestrator = new TtpOrchestratorNode2(OrchestratorNodeName);
     40      Orchestrator = new TtpOrchestratorNode3(OrchestratorNodeName);
    4141      MetaSolver = new OrchestratedAlgorithmNode(MetaSolverNodeName);
    4242      TspSolver = new OrchestratedAlgorithmNode(TspSolverNodeName);
  • 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.