Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/LambdaInterchangeMove.cs @ 4204

Last change on this file since 4204 was 4204, checked in by svonolfe, 14 years ago

Added operations for the Alba encoding (#1039)

File size: 2.5 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 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
22using HeuristicLab.Core;
23using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
24using HeuristicLab.Encodings.PermutationEncoding;
25using HeuristicLab.Common;
26using System.Collections.Generic;
27
28namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
29  [Item("InversionMove", "Item that describes a lambda move on an Alba VRP representation.")]
30  [StorableClass]
31  public class LambdaInterchangeMove: Item {
32    [Storable]
33    public int Tour1 { get; protected set; }
34
35    [Storable]
36    public int Position1 { get; protected set; }
37
38    [Storable]
39    public int Length1 { get; protected set; }
40
41    [Storable]
42    public int Tour2 { get; protected set; }
43
44    [Storable]
45    public int Position2 { get; protected set; }
46
47    [Storable]
48    public int Length2 { get; protected set; }
49   
50    public LambdaInterchangeMove(): base() {
51      Tour1 = -1;
52      Position1 = -1;
53      Length1 = -1;
54
55      Tour2 = -1;
56      Position2 = -1;
57      Length2 = -1;
58    }
59
60    public LambdaInterchangeMove(int tour1, int position1, int length1,
61      int tour2, int position2, int length2) {
62        Tour1 = tour1;
63        Position1 = position1;
64        Length1 = length1;
65
66        Tour2 = tour2;
67        Position2 = position2;
68        Length2 = length2;
69    }
70
71    public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
72      LambdaInterchangeMove clone = new LambdaInterchangeMove();
73
74      clone.Tour1 = Tour1;
75      clone.Position1 = Position1;
76      clone.Length1 = Length1;
77
78      clone.Tour2 = Tour2;
79      clone.Position2 = Position2;
80      clone.Length2 = Length2;
81
82      cloner.RegisterClonedObject(this, clone);
83      return clone;
84    }
85  }
86}
Note: See TracBrowser for help on using the repository browser.