1 | using HeuristicLab.Common;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 | using HeuristicLab.Encodings.PermutationEncoding;
|
---|
4 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
5 |
|
---|
6 | namespace HeuristicLab.Problems.PTSP {
|
---|
7 | public class TwoPointFiveMove : Item {
|
---|
8 |
|
---|
9 | [StorableConstructor]
|
---|
10 | public TwoPointFiveMove() : this(-1, -1,null, true) { }
|
---|
11 | protected TwoPointFiveMove(bool deserializing) : base(deserializing) { }
|
---|
12 | protected TwoPointFiveMove(TwoPointFiveMove original, Cloner cloner)
|
---|
13 | : base(original, cloner) {
|
---|
14 | this.Index1 = original.Index1;
|
---|
15 | this.Index2 = original.Index2;
|
---|
16 | this.IsInvert = original.IsInvert;
|
---|
17 | if (original.Permutation != null)
|
---|
18 | this.Permutation = cloner.Clone(original.Permutation);
|
---|
19 | }
|
---|
20 | public TwoPointFiveMove(int index1, int index2, Permutation permutation, bool isinvert)
|
---|
21 | : base() {
|
---|
22 | Index1 = index1;
|
---|
23 | Index2 = index2;
|
---|
24 | IsInvert = isinvert;
|
---|
25 | Permutation = permutation;
|
---|
26 | }
|
---|
27 |
|
---|
28 | public TwoPointFiveMove(int index1, int index2, bool isinvert)
|
---|
29 | : base() {
|
---|
30 | Index1 = index1;
|
---|
31 | Index2 = index2;
|
---|
32 | IsInvert = isinvert;
|
---|
33 | Permutation = null;
|
---|
34 | }
|
---|
35 |
|
---|
36 | [Storable]
|
---|
37 | public int Index1 { get; protected set; }
|
---|
38 | [Storable]
|
---|
39 | public int Index2 { get; protected set; }
|
---|
40 | [Storable]
|
---|
41 | public Permutation Permutation { get; protected set; }
|
---|
42 | [Storable]
|
---|
43 | public bool IsInvert { get; protected set; }
|
---|
44 |
|
---|
45 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
46 | return new TwoPointFiveMove(this, cloner);
|
---|
47 | }
|
---|
48 | }
|
---|
49 | }
|
---|