[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
|
---|
| 21 |
|
---|
| 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.Optimization;
|
---|
| 28 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 29 |
|
---|
| 30 | namespace HeuristicLab.Networks.IntegratedOptimization.TravelingThief {
|
---|
| 31 | [Item("TtpNetwork2", "Version 2 of a TTP optimization network.")]
|
---|
| 32 | [Creatable("Optimization Networks")]
|
---|
| 33 | [StorableClass]
|
---|
[14610] | 34 | public sealed class TtpNetwork2 : TtpNetwork, IOptimizer {
|
---|
[14601] | 35 | [StorableConstructor]
|
---|
| 36 | private TtpNetwork2(bool deserializing) : base(deserializing) { }
|
---|
[14610] | 37 | private TtpNetwork2(TtpNetwork2 original, Cloner cloner) : base(original, cloner) { }
|
---|
| 38 | public TtpNetwork2() : this("TtpNetwork2") { }
|
---|
| 39 | public TtpNetwork2(string name) : base(name) {
|
---|
[14601] | 40 | var cmaes = new CMAEvolutionStrategy();
|
---|
| 41 | cmaes.Problem = new VariegationProblem();
|
---|
| 42 | cmaes.MaximumGenerations = 80;
|
---|
[14610] | 43 | MetaSolver.Algorithm = cmaes;
|
---|
| 44 | Orchestrator.MetaSolverOrchestrationPort.ConnectedPort = MetaSolver.OrchestrationPort;
|
---|
[14601] | 45 |
|
---|
| 46 | var ls = new LocalSearch();
|
---|
[14610] | 47 | ls.Problem = Orchestrator.KspParameter.Value;
|
---|
[14601] | 48 | ls.MaximumIterations.Value = 100;
|
---|
| 49 | ls.SampleSize.Value = 2000;
|
---|
[14610] | 50 | TspSolver.Algorithm = ls;
|
---|
| 51 | Orchestrator.TspSolverOrchestrationPort.ConnectedPort = TspSolver.OrchestrationPort;
|
---|
[14601] | 52 |
|
---|
| 53 | var p3 = new ParameterlessPopulationPyramid();
|
---|
| 54 | p3.Problem = new LootProfitProblem();
|
---|
| 55 | p3.MaximumRuntime = 3;
|
---|
[14610] | 56 | KspSolver.Algorithm = p3;
|
---|
| 57 | Orchestrator.KspSolverOrchestrationPort.ConnectedPort = KspSolver.OrchestrationPort;
|
---|
[14601] | 58 | }
|
---|
| 59 |
|
---|
| 60 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 61 | return new TtpNetwork2(this, cloner);
|
---|
| 62 | }
|
---|
| 63 | }
|
---|
| 64 | }
|
---|