Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/12/16 19:54:35 (8 years ago)
Author:
gkronber
Message:

#1966: renamed *PackingDimension -> PackingPosition

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/PackingPosition.cs

    r14047 r14048  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Common;
    26 using HeuristicLab.Problems.BinPacking;
    2726
    2827namespace HeuristicLab.Problems.BinPacking3D {
    29   [Item("Three Dimensional Packing", "Represents a packing-position associated with a three dimensional packing-problem.")]
     28  [Item("Packing Position (3d)", "Represents a packing-position associated with a three dimensional packing-problem.")]
    3029  [StorableClass]
    31   // ThreeDimensionalPacking is immutable (and handled as value type concerning Equals and GetHashCode)
    32   public class ThreeDimensionalPacking : PackingDimensions {
     30  // PackingPosition is immutable (and handled as value type concerning Equals and GetHashCode)
     31  public class PackingPosition : BinPacking.PackingPosition {
    3332    [Storable]
    3433    private readonly int x;
     
    4342
    4443    [StorableConstructor]
    45     protected ThreeDimensionalPacking(bool deserializing) : base(deserializing) { }
    46     protected ThreeDimensionalPacking(ThreeDimensionalPacking original, Cloner cloner)
     44    protected PackingPosition(bool deserializing) : base(deserializing) { }
     45    protected PackingPosition(PackingPosition original, Cloner cloner)
    4746      : base(original, cloner) {
    4847      x = original.X;
     
    5150    }
    5251    public override IDeepCloneable Clone(Cloner cloner) {
    53       return new ThreeDimensionalPacking(this, cloner);
     52      return new PackingPosition(this, cloner);
    5453    }
    5554
    56     public ThreeDimensionalPacking(int assignedBin, int x, int y, int z, bool rotated = false)
     55    public PackingPosition(int assignedBin, int x, int y, int z, bool rotated = false)
    5756      : base(assignedBin, rotated) {
    5857      this.x = x;
     
    6766
    6867    public override bool Equals(object obj) {
    69       var tdp = obj as ThreeDimensionalPacking;
     68      var tdp = obj as PackingPosition;
    7069      if (tdp != null)
    7170        return (tdp.X == this.X && tdp.Y == this.Y && tdp.Z == this.Z);
     
    7776    }
    7877
    79     public static ThreeDimensionalPacking MoveLeft(ThreeDimensionalPacking original) {
    80       return new ThreeDimensionalPacking(original.AssignedBin, original.X - 1, original.Y, original.Z, original.Rotated);
     78    public static PackingPosition MoveLeft(PackingPosition original) {
     79      return new PackingPosition(original.AssignedBin, original.X - 1, original.Y, original.Z, original.Rotated);
    8180    }
    82     public static ThreeDimensionalPacking MoveDown(ThreeDimensionalPacking original) {
    83       return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y - 1, original.Z, original.Rotated);
     81    public static PackingPosition MoveDown(PackingPosition original) {
     82      return new PackingPosition(original.AssignedBin, original.X, original.Y - 1, original.Z, original.Rotated);
    8483    }
    85     public static ThreeDimensionalPacking MoveBack(ThreeDimensionalPacking original) {
    86       return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y, original.Z - 1, original.Rotated);
     84    public static PackingPosition MoveBack(PackingPosition original) {
     85      return new PackingPosition(original.AssignedBin, original.X, original.Y, original.Z - 1, original.Rotated);
    8786    }
    8887
    89     public static ThreeDimensionalPacking MoveRight(ThreeDimensionalPacking original) {
    90       return new ThreeDimensionalPacking(original.AssignedBin, original.X + 1, original.Y, original.Z, original.Rotated);
     88    public static PackingPosition MoveRight(PackingPosition original) {
     89      return new PackingPosition(original.AssignedBin, original.X + 1, original.Y, original.Z, original.Rotated);
    9190    }
    92     public static ThreeDimensionalPacking MoveUp(ThreeDimensionalPacking original) {
    93       return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y + 1, original.Z, original.Rotated);
     91    public static PackingPosition MoveUp(PackingPosition original) {
     92      return new PackingPosition(original.AssignedBin, original.X, original.Y + 1, original.Z, original.Rotated);
    9493    }
    95     public static ThreeDimensionalPacking MoveFront(ThreeDimensionalPacking original) {
    96       return new ThreeDimensionalPacking(original.AssignedBin, original.X, original.Y, original.Z + 1, original.Rotated);
     94    public static PackingPosition MoveFront(PackingPosition original) {
     95      return new PackingPosition(original.AssignedBin, original.X, original.Y, original.Z + 1, original.Rotated);
    9796    }
    9897  }
Note: See TracChangeset for help on using the changeset viewer.