- Timestamp:
- 12/14/15 19:52:46 (9 years ago)
- Location:
- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceInversionManipulator.cs
r13032 r13461 33 33 [StorableConstructor] 34 34 protected PackingSequenceInversionManipulator(bool deserializing) : base(deserializing) { } 35 protected PackingSequenceInversionManipulator(PackingSequence Manipulator original, Cloner cloner) : base(original, cloner) { }35 protected PackingSequenceInversionManipulator(PackingSequenceInversionManipulator original, Cloner cloner) : base(original, cloner) { } 36 36 public PackingSequenceInversionManipulator() 37 37 : base() { 38 38 EncodedSolutionParameter.ActualName = "PackingSequence"; 39 39 } 40 40 public override IDeepCloneable Clone(Cloner cloner) { … … 44 44 protected override void Manipulate(IRandom random, PackingSequenceEncoding individual) { 45 45 InversionManipulator.Apply(random, individual.PackingSequence); 46 } 46 } 47 47 } 48 48 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceScrambleManipulator.cs
r13032 r13461 32 32 [StorableConstructor] 33 33 protected PackingSequenceScrambleManipulator(bool deserializing) : base(deserializing) { } 34 protected PackingSequenceScrambleManipulator(PackingSequence Manipulator original, Cloner cloner) : base(original, cloner) { }34 protected PackingSequenceScrambleManipulator(PackingSequenceScrambleManipulator original, Cloner cloner) : base(original, cloner) { } 35 35 public PackingSequenceScrambleManipulator() 36 36 : base() { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj
r13460 r13461 155 155 <Reference Include="System.Drawing" /> 156 156 <Reference Include="System.IO.Compression" /> 157 <Reference Include="System.IO.Compression.FileSystem" />158 157 <Reference Include="System.Windows.Forms" /> 159 158 </ItemGroup> -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/IPackingShape.cs
r13032 r13461 23 23 24 24 namespace HeuristicLab.Problems.BinPacking.Interfaces { 25 public interface IPackingShape : I NamedItem {25 public interface IPackingShape : IItem { 26 26 } 27 27 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingBin/CuboidPackingBin.cs
r13032 r13461 31 31 [StorableClass] 32 32 public class CuboidPackingBin : CuboidPackingShape, IPackingBin { 33 34 public CuboidPackingBin(int width, int height, int depth) : base (width, height, depth) {}33 34 public CuboidPackingBin(int width, int height, int depth) : base(width, height, depth) { } 35 35 36 36 [StorableConstructor] … … 42 42 return new CuboidPackingBin(this, cloner); 43 43 } 44 public CuboidPackingBin() : base() {45 44 public CuboidPackingBin() 45 : base() { 46 46 } 47 47 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingBin/RectangularPackingBin.cs
r13032 r13461 32 32 33 33 public RectangularPackingBin(int width, int height) : base(width, height) { } 34 public RectangularPackingBin() : base() { 34 public RectangularPackingBin() 35 : base() { 35 36 36 37 } … … 40 41 protected RectangularPackingBin(RectangularPackingBin original, Cloner cloner) 41 42 : base(original, cloner) { 42 } 43 } 43 44 public override IDeepCloneable Clone(Cloner cloner) { 44 45 return new RectangularPackingBin(this, cloner); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingItem/CuboidPackingItem.cs
r13032 r13461 51 51 } 52 52 public CuboidPackingItem() : base() { 53 54 53 } 55 54 -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingItem/RectangularPackingItem.cs
r13032 r13461 31 31 [Item("RectangularPackingItem", "Represents a rectangular packing-item for bin-packing problems.")] 32 32 [StorableClass] 33 public class RectangularPackingItem : RectangularPackingShape, IPackingItem {33 public class RectangularPackingItem : RectangularPackingShape, IPackingItem { 34 34 35 35 public RectangularPackingBin TargetBin { get; set; } … … 50 50 return new RectangularPackingItem(this, cloner); 51 51 } 52 public RectangularPackingItem() : base() { 52 public RectangularPackingItem() 53 : base() { 53 54 } 54 55 55 56 public RectangularPackingItem(int width, int height, RectangularPackingBin targetBin) : base(width, height) { this.TargetBin = new RectangularPackingBin(targetBin.Width, targetBin.Height); } 56 57 57 58 public void AddTargetBinMeasures(int[] targetBinMeasures) { 58 59 TargetBin = new RectangularPackingBin(targetBinMeasures[0], targetBinMeasures[1]); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs.frame
r13032 r13461 29 29 [PluginFile("HeuristicLab.Problems.BinPacking-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Common", "3.3")] 31 [PluginDependency("HeuristicLab.Common.Resources", "3.3")]32 31 [PluginDependency("HeuristicLab.Core", "3.3")] 32 [PluginDependency("HeuristicLab.Data", "3.3")] 33 [PluginDependency("HeuristicLab.Encodings.IntegerVectorEncoding", "3.3")] 34 [PluginDependency("HeuristicLab.Collections", "3.3")] 35 [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")] 36 [PluginDependency("HeuristicLab.Optimization", "3.3")] 37 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 38 [PluginDependency("HeuristicLab.Parameters", "3.3")] 33 39 [PluginDependency("HeuristicLab.Persistence", "3.3")] 40 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 34 41 public class HeuristicLabProblemsBinPackingPlugin : PluginBase { 35 42 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/RegularIdenticalBinPackingProblem.cs
r13460 r13461 47 47 48 48 #region Parameter Properties 49 public ValueParameter<B> PackingBinMeasuresParameter {50 get { return ( ValueParameter<B>)Parameters["PackingBinMeasures"]; }51 } 52 public ConstrainedValueParameter<IPackingSolutionDecoder> PackingSolutionDecoderParameter {53 get { return ( ConstrainedValueParameter<IPackingSolutionDecoder>)Parameters["PackingSolutionDecoder"]; }49 public IValueParameter<B> PackingBinMeasuresParameter { 50 get { return (IValueParameter<B>)Parameters["PackingBinMeasures"]; } 51 } 52 public IConstrainedValueParameter<IPackingSolutionDecoder> PackingSolutionDecoderParameter { 53 get { return (IConstrainedValueParameter<IPackingSolutionDecoder>)Parameters["PackingSolutionDecoder"]; } 54 54 } 55 55 #endregion -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/CuboidPackingShape.cs
r13032 r13461 31 31 [StorableClass] 32 32 public abstract class CuboidPackingShape : PackingShape<ThreeDimensionalPacking>, IRegularPackingShape, IComparable<CuboidPackingShape> { 33 #region Properties 33 #region Properties 34 34 /// <summary> 35 35 /// Describes the size on the X-axis … … 62 62 } 63 63 public override bool Encloses(ThreeDimensionalPacking checkedPosition, PackingShape<ThreeDimensionalPacking> checkedShape) { 64 return Encloses(checkedPosition, (CuboidPackingShape) 64 return Encloses(checkedPosition, (CuboidPackingShape)checkedShape); 65 65 } 66 66 private bool Encloses(ThreeDimensionalPacking checkedPosition, CuboidPackingShape checkedShape) { 67 67 return Encloses(new CuboidDiagonal(this), new CuboidDiagonal(checkedPosition, checkedShape)); 68 } 68 } 69 69 private bool Encloses(CuboidDiagonal c1, CuboidDiagonal c2) { 70 70 return (c1.x1 <= c2.x1 && … … 84 84 private bool Overlaps(CuboidDiagonal c1, CuboidDiagonal c2) { 85 85 return !(c1.x1 > c2.x2 || 86 c1.y1 > c2.y2 || 86 c1.y1 > c2.y2 || 87 87 c1.z1 > c2.z2 || 88 88 c1.x2 < c2.x1 || … … 98 98 } 99 99 } 100 #endregion 100 #endregion 101 101 102 public CuboidPackingShape(int width, int height, int depth) : base () { 102 protected CuboidPackingShape(int width, int height, int depth) 103 : base() { 103 104 this.Width = width; 104 105 this.Height = height; … … 108 109 public override void InitializeFromMeasures(int[] measures) { 109 110 if (measures.Length != 3) 110 throw new InvalidOperationException("Nr of measures does not fit shape-dimension."); 111 throw new InvalidOperationException("Nr of measures does not fit shape-dimension."); 111 112 this.Width = measures[0]; 112 113 this.Height = measures[1]; … … 125 126 this.Depth = original.Depth; 126 127 } 127 public CuboidPackingShape() : base(){ } 128 129 protected CuboidPackingShape() : base() { } 128 130 129 131 public override string ToString() { … … 136 138 //Using "Clustered-Area-Height"-comparison as descr 137 139 138 int result = (this.Width * this.Depth).CompareTo (other.Width * other.Depth); 139 140 if (result == 0) 141 result = this.MultipliedMeasures.CompareTo(other.MultipliedMeasures); 142 //if (result == 0) { 143 // result = this.Depth.CompareTo(other.Depth) + this.Width.CompareTo(other.Width); 144 // if (result == 0) { 145 // result = this.Width.CompareTo(other.Width); 146 if (result == 0) 147 result = this.Height.CompareTo(other.Height); 148 // } 149 //} 140 int result = (this.Width * this.Depth).CompareTo(other.Width * other.Depth); 141 142 if (result == 0) 143 result = this.MultipliedMeasures.CompareTo(other.MultipliedMeasures); 144 if (result == 0) 145 result = this.Height.CompareTo(other.Height); 150 146 return result; 151 } 147 } 152 148 153 149 public int CompareTo(object obj) { 154 if (obj.GetType() .Equals(this.GetType()))150 if (obj.GetType() == this.GetType()) 155 151 return this.CompareTo((CuboidPackingShape)obj); 156 152 else return 0; 157 153 } 158 154 159 #endregion 155 #endregion 160 156 161 157 private struct CuboidDiagonal { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/PackingShape.cs
r13032 r13461 30 30 [Item("PackingShape", "Represents an abstract shape to describe the measures and the positioning of objects related to bin-packing problems.")] 31 31 [StorableClass] 32 public abstract class PackingShape<D> : NamedItem, IPackingShape 33 where D: class, IPackingDimensions 34 { 32 public abstract class PackingShape<D> : Item, IPackingShape 33 where D : class, IPackingDimensions { 35 34 public static Type PositionType { 36 35 get { return typeof(D); } … … 45 44 public abstract D Origin { get; } 46 45 47 p ublicPackingShape(int[] measures) {46 protected PackingShape(int[] measures) { 48 47 InitializeFromMeasures(measures); 49 48 } 50 public PackingShape() {51 49 52 }50 protected PackingShape() { } 53 51 54 52
Note: See TracChangeset
for help on using the changeset viewer.