[14601] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
| 3 | * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
| 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
[14586] | 21 |
|
---|
[14601] | 22 | using HeuristicLab.Algorithms.CMAEvolutionStrategy;
|
---|
| 23 | using HeuristicLab.Algorithms.LocalSearch;
|
---|
| 24 | using HeuristicLab.Algorithms.ParameterlessPopulationPyramid;
|
---|
| 25 | using HeuristicLab.Common;
|
---|
| 26 | using HeuristicLab.Core;
|
---|
| 27 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
[14586] | 28 |
|
---|
[14601] | 29 | namespace HeuristicLab.Networks.IntegratedOptimization.TravelingThief {
|
---|
| 30 | [Item("TtpNetwork3", "Version 3 of a TTP optimization network.")]
|
---|
| 31 | [Creatable("Optimization Networks")]
|
---|
| 32 | [StorableClass]
|
---|
[14621] | 33 | public sealed class TtpNetwork3 : TtpNetwork {
|
---|
[14601] | 34 | [StorableConstructor]
|
---|
| 35 | private TtpNetwork3(bool deserializing) : base(deserializing) { }
|
---|
[14610] | 36 | private TtpNetwork3(TtpNetwork3 original, Cloner cloner) : base(original, cloner) { }
|
---|
| 37 | public TtpNetwork3() : this("TtpNetwork3") { }
|
---|
| 38 | public TtpNetwork3(string name) : base(name) {
|
---|
[14616] | 39 | Orchestrator = new TtpOrchestratorNode2(OrchestratorNodeName);
|
---|
| 40 | MetaSolver = new OrchestratedAlgorithmNode(MetaSolverNodeName);
|
---|
| 41 | TspSolver = new OrchestratedAlgorithmNode(TspSolverNodeName);
|
---|
| 42 | KspSolver = new OrchestratedAlgorithmNode(KspSolverNodeName);
|
---|
| 43 |
|
---|
[14601] | 44 | var cmaes = new CMAEvolutionStrategy();
|
---|
| 45 | cmaes.Problem = new VariegationProblem();
|
---|
| 46 | cmaes.MaximumGenerations = 80;
|
---|
[14610] | 47 | MetaSolver.Algorithm = cmaes;
|
---|
| 48 | Orchestrator.MetaSolverOrchestrationPort.ConnectedPort = MetaSolver.OrchestrationPort;
|
---|
[14601] | 49 |
|
---|
| 50 | var ls = new LocalSearch();
|
---|
[14616] | 51 | ls.Problem = Orchestrator.TspParameter.Value;
|
---|
[14601] | 52 | ls.MaximumIterations.Value = 100;
|
---|
| 53 | ls.SampleSize.Value = 2000;
|
---|
[14610] | 54 | TspSolver.Algorithm = ls;
|
---|
| 55 | Orchestrator.TspSolverOrchestrationPort.ConnectedPort = TspSolver.OrchestrationPort;
|
---|
[14601] | 56 |
|
---|
| 57 | var p3 = new ParameterlessPopulationPyramid();
|
---|
[14610] | 58 | p3.Problem = Orchestrator.KspParameter.Value;
|
---|
[14601] | 59 | p3.MaximumRuntime = 3;
|
---|
[14610] | 60 | KspSolver.Algorithm = p3;
|
---|
| 61 | Orchestrator.KspSolverOrchestrationPort.ConnectedPort = KspSolver.OrchestrationPort;
|
---|
[14601] | 62 | }
|
---|
| 63 |
|
---|
| 64 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 65 | return new TtpNetwork3(this, cloner);
|
---|
| 66 | }
|
---|
| 67 | }
|
---|
| 68 | }
|
---|