Ignore:
Timestamp:
02/22/12 22:43:09 (8 years ago)
Author:
abeham
Message:

#1614

  • added instances of Cordeau et al. as given by L. Moccia
  • added operators for tabu search
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/NMove.cs

    r7407 r7505  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    2728
    2829namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment {
    29   [Item("n-move", "An n-move describes moving n equipments to n locations.")]
     30  [Item("N-Move", "An N-Move describes the relocation of n equipments to n different locations.")]
    3031  [StorableClass]
    3132  public class NMove : Item {
    3233    [Storable]
    33     public int[] Equipments { get; private set; }
    34     [Storable]
    35     public int[] Locations { get; private set; }
     34    public Dictionary<int, int> NewAssignments { get; private set; }
    3635    [Storable]
    3736    public IntegerVector OriginalVector { get; private set; }
    3837
    39     public int N { get { return Equipments.Length; } }
     38    public int N { get { return NewAssignments.Count; } }
    4039
    4140    [StorableConstructor]
     
    4342    protected NMove(NMove original, Cloner cloner)
    4443      : base(original, cloner) {
    45       Equipments = (int[])original.Equipments.Clone();
    46       Locations = (int[])original.Locations.Clone();
     44      NewAssignments = new Dictionary<int, int>(original.NewAssignments);
    4745      if (original.OriginalVector != null)
    4846        OriginalVector = cloner.Clone(original.OriginalVector);
     
    5553      if (locations == null) throw new ArgumentNullException("locations", "NMove: Locations must not be null.");
    5654      if (equipments.Length != locations.Length) throw new ArgumentException("NMove: Length of equipments and locations is not identical.");
    57       Equipments = equipments;
    58       Locations = locations;
     55      NewAssignments = new Dictionary<int, int>();
     56      for (int i = 0; i < equipments.Length; i++)
     57        NewAssignments[equipments[i]] = locations[i];
    5958      OriginalVector = originalVector;
    6059    }
Note: See TracChangeset for help on using the changeset viewer.