Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/30/17 10:28:58 (7 years ago)
Author:
jkarder
Message:

#2205: worked on optimization networks

File:
1 edited

Legend:

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

    r14610 r14616  
    4141    private TtpOrchestratorNode2(TtpOrchestratorNode2 original, Cloner cloner) : base(original, cloner) { }
    4242    public TtpOrchestratorNode2() : this("TtpOrchestratorNode2") { }
    43     public TtpOrchestratorNode2(string name) : base(name) { }
     43    public TtpOrchestratorNode2(string name) : base(name) {
     44      MetaSolverOrchestrationPort = CreateOrchestrationPort<VariegationProblem>(MetaSolverName);
     45      MetaSolverEvaluationPort = CreateEvaluationPort<RealVector>(MetaSolverName, "RealVector", "Quality");
     46      TspSolverOrchestrationPort = CreateOrchestrationPort<TravelingSalesmanProblem>(TspSolverName);
     47      KspSolverOrchestrationPort = CreateOrchestrationPort<LootProfitProblem>(KspSolverName);
     48    }
    4449
    4550    public override IDeepCloneable Clone(Cloner cloner) {
    4651      return new TtpOrchestratorNode2(this, cloner);
     52    }
     53
     54    public override void Prepare(bool clearRuns = false) {
     55      base.Prepare(clearRuns);
     56
     57      var metaMsg = MetaSolverOrchestrationPort.PrepareMessage();
     58      var msgFlags = OrchestrationMessage.Prepare | OrchestrationMessage.SetEvalHook;
     59      if (clearRuns) msgFlags |= OrchestrationMessage.ClearRuns;
     60      metaMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(msgFlags);
     61      var problem = new VariegationProblem();
     62      problem.Encoding.Length = TspParameter.Value.Coordinates.Rows * 2;
     63      problem.Encoding.Bounds = new DoubleMatrix(new[,] { { -1.0, 1.0 } });
     64      metaMsg["Problem"] = problem;
     65      MetaSolverOrchestrationPort.SendMessage(metaMsg);
    4766    }
    4867
Note: See TracChangeset for help on using the changeset viewer.