Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/31/17 16:54:03 (7 years ago)
Author:
jkarder
Message:

#2205: worked on optimization networks

  • added variegation problem for minimization and maximization
  • refactored some classes
File:
1 edited

Legend:

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

    r14616 r14628  
    4343    public TtpOrchestratorNode3() : this("TtpOrchestratorNode3") { }
    4444    public TtpOrchestratorNode3(string name) : base(name) {
    45       MetaSolverOrchestrationPort = CreateOrchestrationPort<VariegationProblem>(MetaSolverName);
    46       MetaSolverEvaluationPort = CreateEvaluationPort<RealVector>(MetaSolverName, "RealVector", "Quality");
    47       TspSolverOrchestrationPort = CreateOrchestrationPort<TravelingSalesmanProblem>(TspSolverName);
    48       KspSolverOrchestrationPort = CreateOrchestrationPort<BinaryKnapsackProblem>(KspSolverName);
     45      MetaSolverOrchestrationPort = CreateOrchestrationPort<MaximizationVariegationProblem<RealVectorEncoding>>(MetaSolverName + OrchestrationPortNameSuffix);
     46      MetaSolverEvaluationPort = CreateEvaluationPort<RealVector>(MetaSolverName + EvaluationPortNameSuffix, "RealVector", "Quality");
     47      TspSolverOrchestrationPort = CreateOrchestrationPort<TravelingSalesmanProblem>(TspSolverName + OrchestrationPortNameSuffix);
     48      KspSolverOrchestrationPort = CreateOrchestrationPort<BinaryKnapsackProblem>(KspSolverName + OrchestrationPortNameSuffix);
    4949    }
    5050
     
    6060      if (clearRuns) msgFlags |= OrchestrationMessage.ClearRuns;
    6161      metaMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(msgFlags);
    62       var problem = new VariegationProblem();
     62      var problem = new MaximizationVariegationProblem<RealVectorEncoding>();
    6363      problem.Encoding.Length = KspParameter.Value.Length + TspParameter.Value.Coordinates.Rows * 2;
    6464      problem.Encoding.Bounds = new DoubleMatrix(new[,] { { -1.0, 1.0 } });
     
    8484      cts.Token.ThrowIfCancellationRequested();
    8585
     86      var kspResults = (ResultCollection)kspMsg["Results"];
    8687      var bestKspSolution = (BinaryVector)kspResults["Best Solution"].Value.Clone();
    8788      var kspCapacity = (IntValue)KspParameter.Value.KnapsackCapacity.Clone();
     
    115116      cts.Token.ThrowIfCancellationRequested();
    116117
     118      var tspResults = (ResultCollection)tspMsg["Results"];
    117119      var bestTspSolution = (Permutation)tspResults["Best TSP Solution"].Value.Clone();
    118120      var coordinates = (DoubleMatrix)TspParameter.Value.Coordinates.Clone();
Note: See TracChangeset for help on using the changeset viewer.