1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2014 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 System.Collections.Generic;
|
---|
23 | using System.Drawing;
|
---|
24 | using System.Threading;
|
---|
25 | using HeuristicLab.Common;
|
---|
26 | using HeuristicLab.Core;
|
---|
27 | using HeuristicLab.Data;
|
---|
28 | using HeuristicLab.Encodings.BinaryVectorEncoding;
|
---|
29 | using HeuristicLab.Encodings.PermutationEncoding;
|
---|
30 | using HeuristicLab.Networks.Programmable;
|
---|
31 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
32 |
|
---|
33 | namespace HeuristicLab.Networks {
|
---|
34 | [Item("KSPTSPControl", "A node of an optimization network which connects a KSP and a TSP.")]
|
---|
35 | [StorableClass]
|
---|
36 | public class KSPTSPControl : ProgrammableNode {
|
---|
37 | public static new Image StaticItemImage {
|
---|
38 | get { return HeuristicLab.Common.Resources.VSImageLibrary.RadialChart; }
|
---|
39 | }
|
---|
40 | public object Locker = new object();
|
---|
41 |
|
---|
42 | [Storable]
|
---|
43 | public List<BinaryVector> SelectedCities = new List<BinaryVector>();
|
---|
44 | [Storable]
|
---|
45 | public List<Permutation> PredefinedTrip = new List<Permutation>();
|
---|
46 |
|
---|
47 | public AutoResetEvent TspWait = new AutoResetEvent(false);
|
---|
48 | public AutoResetEvent KspWait = new AutoResetEvent(false);
|
---|
49 |
|
---|
50 | [Storable]
|
---|
51 | public DoubleMatrix Coordinates, Distances;
|
---|
52 | [Storable]
|
---|
53 | public IntArray CityValues, CityWeights;
|
---|
54 | [Storable]
|
---|
55 | public DoubleValue TransportCostFactor;
|
---|
56 | [Storable]
|
---|
57 | public IntValue CityLimit;
|
---|
58 |
|
---|
59 | protected override string CodeTemplate {
|
---|
60 | get { return ReadCodeTemplate("HeuristicLab.Networks.KSPTSPControlCode.cs"); }
|
---|
61 | }
|
---|
62 |
|
---|
63 | [StorableConstructor]
|
---|
64 | protected KSPTSPControl(bool deserializing) : base(deserializing) { }
|
---|
65 | protected KSPTSPControl(KSPTSPControl original, Cloner cloner) : base(original, cloner) { }
|
---|
66 | public KSPTSPControl() : base("KSPTSPControl") { }
|
---|
67 | public KSPTSPControl(string name) : base(name) { }
|
---|
68 | public KSPTSPControl(string name, string description) : base(name, description) { }
|
---|
69 |
|
---|
70 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
71 | return new KSPTSPControl(this, cloner);
|
---|
72 | }
|
---|
73 | }
|
---|
74 | }
|
---|