Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13605


Ignore:
Timestamp:
02/08/16 20:42:24 (9 years ago)
Author:
gkronber
Message:

#1966 refactoring

Location:
branches/HeuristicLab.BinPacking
Files:
9 added
1 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.BinPacking.sln

    r13028 r13605  
    1313Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.BinPacking.Views-3.3", "HeuristicLab.Problems.BinPacking.Views\3.3\HeuristicLab.Problems.BinPacking.Views-3.3.csproj", "{78763A4E-E163-48C2-98EB-709760D06F25}"
    1414EndProject
    15 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackingPlanVisualizations", "PackingPlanVisualizations\PackingPlanVisualizations.csproj", "{0FD5EA67-A284-4166-9F45-9C6BC07D5B83}"
     15Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.BinPacking2D-3.3", "HeuristicLab.Problems.BinPacking.2D\3.3\HeuristicLab.Problems.BinPacking2D-3.3.csproj", "{56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}"
    1616EndProject
    1717Global
     
    5959    {78763A4E-E163-48C2-98EB-709760D06F25}.Release|x86.ActiveCfg = Release|x86
    6060    {78763A4E-E163-48C2-98EB-709760D06F25}.Release|x86.Build.0 = Release|x86
    61     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    62     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Debug|Any CPU.Build.0 = Debug|Any CPU
    63     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
    64     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
    65     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Debug|x64.ActiveCfg = Debug|Any CPU
    66     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Debug|x86.ActiveCfg = Debug|Any CPU
    67     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Release|Any CPU.ActiveCfg = Release|Any CPU
    68     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Release|Any CPU.Build.0 = Release|Any CPU
    69     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
    70     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Release|Mixed Platforms.Build.0 = Release|Any CPU
    71     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Release|x64.ActiveCfg = Release|Any CPU
    72     {0FD5EA67-A284-4166-9F45-9C6BC07D5B83}.Release|x86.ActiveCfg = Release|Any CPU
     61    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     62    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Debug|Any CPU.Build.0 = Debug|Any CPU
     63    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     64    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Debug|Mixed Platforms.Build.0 = Debug|x86
     65    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Debug|x64.ActiveCfg = Debug|x64
     66    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Debug|x64.Build.0 = Debug|x64
     67    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Debug|x86.ActiveCfg = Debug|x86
     68    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Debug|x86.Build.0 = Debug|x86
     69    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Release|Any CPU.ActiveCfg = Release|Any CPU
     70    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Release|Any CPU.Build.0 = Release|Any CPU
     71    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Release|Mixed Platforms.ActiveCfg = Release|x86
     72    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Release|Mixed Platforms.Build.0 = Release|x86
     73    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Release|x64.ActiveCfg = Release|x64
     74    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Release|x64.Build.0 = Release|x64
     75    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Release|x86.ActiveCfg = Release|x86
     76    {56DD7F51-3164-4C26-A97A-ADD6FE4B4E86}.Release|x86.Build.0 = Release|x86
    7377  EndGlobalSection
    7478  GlobalSection(SolutionProperties) = preSolution
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Container2DView.xaml

    r13578 r13605  
    1 <UserControl x:Class="HeuristicLab.Problems.BinPacking.Views.Container2DView"
     1<!--
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Joseph Helm and 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-->
     21
     22<UserControl x:Class="HeuristicLab.Problems.BinPacking.Views.Container2DView"
    223             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    324             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Container2DView.xaml.cs

    r13578 r13605  
    1 using System;
    2 using System.Linq;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Joseph Helm and 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 System;
    323using System.Windows;
    4 using System.Windows.Forms;
    5 using System.Windows.Input;
    624using System.Windows.Media;
    7 using System.Windows.Media.Media3D;
    825using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
    926using HeuristicLab.Problems.BinPacking.Dimensions;
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Container3DView.xaml

    r13576 r13605  
    1 <UserControl x:Class="HeuristicLab.Problems.BinPacking.Views.Container3DView"
     1<!--
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Joseph Helm and 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-->
     21
     22<UserControl x:Class="HeuristicLab.Problems.BinPacking.Views.Container3DView"
    223             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    324             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Container3DView.xaml.cs

    r13576 r13605  
    1 using System;
     1/* HeuristicLab
     2 * Copyright (C) 2002-2015 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 *
     4 * This file is part of HeuristicLab.
     5 *
     6 * HeuristicLab is free software: you can redistribute it and/or modify
     7 * it under the terms of the GNU General Public License as published by
     8 * the Free Software Foundation, either version 3 of the License, or
     9 * (at your option) any later version.
     10 *
     11 * HeuristicLab is distributed in the hope that it will be useful,
     12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 * GNU General Public License for more details.
     15 *
     16 * You should have received a copy of the GNU General Public License
     17 * along with HeuristicLab. If not, see<http://www.gnu.org/licenses/> .
     18 */
     19
     20using System;
    221using System.Linq;
    322using System.Windows;
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/HeuristicLab.Problems.BinPacking.Views-3.3.csproj

    r13578 r13605  
    158158      <DependentUpon>Container2DView.xaml</DependentUpon>
    159159    </Compile>
    160     <Compile Include="PackingPlan2DView.cs">
    161       <SubType>UserControl</SubType>
    162     </Compile>
     160    <Compile Include="PackingPlan2DView.cs" />
    163161    <Compile Include="PackingPlan2DView.Designer.cs">
    164162      <DependentUpon>PackingPlan2DView.cs</DependentUpon>
    165163    </Compile>
    166     <Compile Include="PackingPlan3DView.cs">
    167       <SubType>UserControl</SubType>
    168     </Compile>
     164    <Compile Include="PackingPlan3DView.cs" />
    169165    <Compile Include="PackingPlan3DView.Designer.cs">
    170166      <DependentUpon>PackingPlan3DView.cs</DependentUpon>
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Analyzers/BestBinPackingSolutionAnalyzer.cs

    r13032 r13605  
    3333using HeuristicLab.Problems.BinPacking.Evaluators;
    3434
    35 namespace HeuristicLab.Problems.BinPacking.Analyzers {     
     35namespace HeuristicLab.Problems.BinPacking.Analyzers {
    3636  [Item("BestBinPackingSolutionAnalyzer", "An operator for analyzing the best solution of BinPacking Problems given in packingPlan-representation.")]
    3737  [StorableClass]
     
    4040    where B : PackingShape<D>, IPackingBin, IRegularPackingShape
    4141    where I : PackingShape<D>, IPackingItem, IRegularPackingShape {
    42 
    43     protected BestBinPackingSolutionAnalyzer(BestBinPackingSolutionAnalyzer<D,B,I> original, Cloner cloner)
    44       : base(original, cloner) {
    45     }
    46     public override IDeepCloneable Clone(Cloner cloner) {
    47       return new BestBinPackingSolutionAnalyzer<D,B,I>(this, cloner);
    48     }
    49 
    5042
    5143    public ILookupParameter<IRandom> RandomParameter {
     
    5648    }
    5749
     50    [StorableConstructor]
     51    protected BestBinPackingSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     52    protected BestBinPackingSolutionAnalyzer(BestBinPackingSolutionAnalyzer<D, B, I> original, Cloner cloner)
     53      : base(original, cloner) {
     54    }
    5855    public BestBinPackingSolutionAnalyzer()
    5956      : base() {
    6057      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
     58    }
     59    public override IDeepCloneable Clone(Cloner cloner) {
     60      return new BestBinPackingSolutionAnalyzer<D, B, I>(this, cloner);
    6161    }
    6262
     
    105105      string nocKey = "Nr Of Containers";
    106106      if (!results.ContainsKey(nocKey))
    107         results.Add(new Result(nocKey, new IntValue (bestSolution.NrOfBins)));
     107        results.Add(new Result(nocKey, new IntValue(bestSolution.NrOfBins)));
    108108      else
    109         results[nocKey].Value = new IntValue (bestSolution.NrOfBins);
     109        results[nocKey].Value = new IntValue(bestSolution.NrOfBins);
    110110
    111111      return base.Apply();
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Analyzers/BinPackingAnalyzer.cs

    r13032 r13605  
    4242    }
    4343
    44     protected BinPackingAnalyzer(BinPackingAnalyzer<D,B,I> original, Cloner cloner)
    45       : base(original, cloner) {
    46     }
    47 
    4844    #region Parameter Properties
    4945    public LookupParameter<BoolValue> MaximizationParameter {
     
    7066    #endregion
    7167
    72     public BinPackingAnalyzer()
     68    [StorableConstructor]
     69    protected BinPackingAnalyzer(bool deserializing) : base(deserializing) { }
     70    protected BinPackingAnalyzer(BinPackingAnalyzer<D, B, I> original, Cloner cloner)
     71      : base(original, cloner) {
     72    }
     73    protected BinPackingAnalyzer()
    7374      : base() {
    7475      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
    7576      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the packing solutions which should be analyzed."));
    76       Parameters.Add(new ScopeTreeLookupParameter<PackingPlan<D, B, I>>("PackingPlan", "The solutions from which the best solution has to be chosen from."));
    7777      Parameters.Add(new LookupParameter<PackingPlan<D, B, I>>("BestSolution", "The best performing packing plan."));
    7878      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best packing solution should be stored."));
    7979      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this packing-problem instance."));
    8080      Parameters.Add(new LookupParameter<PackingPlan<D, B, I>>("BestKnownSolution", "The best known solution of this packing-problem instance."));
     81      Parameters.Add(new ScopeTreeLookupParameter<PackingPlan<D, B, I>>("PackingPlan", "The solutions from which the best solution has to be chosen from."));
    8182    }
    8283  }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/PackingDimensions.cs

    r13032 r13605  
    2121
    2222
    23 using System;
    24 using System.Text;
    2523using HeuristicLab.Problems.BinPacking.Interfaces;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3129  [Item("Packing Dimensions", "Represents an abstract packing-position associated with a packing-problem.")]
    3230  [StorableClass]
     31  // PackingDimensions is immutable (and handled as value types concerning Equals and GetHashCode)
    3332  public abstract class PackingDimensions : Item, IPackingDimensions {
    3433    /// <summary>
    3534    /// The number of the bin to which the current item is assigned is stored in this variable. Counting starts at 0 !!!
     35    /// </summary>   
     36    [Storable]
     37    private readonly int assignedBin;
     38    public int AssignedBin {
     39      get { return assignedBin; }
     40    }
     41
     42    [Storable]
     43    private readonly bool rotated;
     44    /// <summary>
     45    /// Determines if the positioned item is to be rotate by 90 degrees or not. (TODO: which axis?)
    3646    /// </summary>
    37     public Int32 AssignedBin { get; set; }
    38     /// <summary>
    39     /// Determins if the positioned item is to be rotate by 90 degrees or not.
    40     /// </summary>
    41     public Boolean Rotated { get; set; }
     47    public bool Rotated {
     48      get { return rotated; }
     49    }
    4250
    4351    [StorableConstructor]
     
    4553    protected PackingDimensions(PackingDimensions original, Cloner cloner)
    4654      : base(original, cloner) {
    47         AssignedBin = original.AssignedBin;
    48         Rotated = original.Rotated;
     55      assignedBin = original.AssignedBin;
     56      rotated = original.Rotated;
    4957    }
    5058
    51     public PackingDimensions(Int32 assignedBin, Boolean rotated) {
    52       this.AssignedBin = assignedBin;
    53       this.Rotated = rotated;
     59    protected PackingDimensions(int assignedBin, bool rotated) {
     60      this.assignedBin = assignedBin;
     61      this.rotated = rotated;
    5462    }
    5563
    5664    public override string ToString() {
    57       StringBuilder sb = new StringBuilder();
    58       sb.Append("[");
    59       sb.Append(AssignedBin + "-");
    60       sb.Append(Rotated);
    61       sb.Append("]");
    62       return sb.ToString();
     65      return string.Format("[{0}-{1}]", AssignedBin, Rotated);
    6366    }
    6467
    6568    public override bool Equals(object obj) {
    66       var pd = obj as PackingDimensions;
    67       if (pd != null)
    68         return (pd.AssignedBin == this.AssignedBin && pd.Rotated == this.Rotated);
     69      var other = obj as PackingDimensions;
     70      if (other != null)
     71        return (other.AssignedBin == this.AssignedBin && other.Rotated == this.Rotated);
    6972      else return false;
    7073    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/ThreeDimensionalPacking.cs

    r13032 r13605  
    2828  [Item("Three Dimensional Packing", "Represents a packing-position associated with a three dimensional packing-problem.")]
    2929  [StorableClass]
    30   public class ThreeDimensionalPacking: PackingDimensions {
    31     public int X { get; set; }
    32     public int Y { get; set; }
    33     public int Z { get; set; }
     30  // ThreeDimensionalPacking is immutable (and handled as value type concerning Equals and GetHashCode)
     31  public class ThreeDimensionalPacking : PackingDimensions {
     32    [Storable]
     33    private readonly int x;
     34    [Storable]
     35    private readonly int y;
     36    [Storable]
     37    private readonly int z;
     38
     39    public int X { get { return x; } }
     40    public int Y { get { return y; } }
     41    public int Z { get { return z; } }
    3442
    3543    [StorableConstructor]
     
    3745    protected ThreeDimensionalPacking(ThreeDimensionalPacking original, Cloner cloner)
    3846      : base(original, cloner) {
    39       X = original.X;
    40       Y = original.Y;
    41       Z = original.Z;
     47      x = original.X;
     48      y = original.Y;
     49      z = original.Z;
    4250    }
    4351    public override IDeepCloneable Clone(Cloner cloner) {
     
    4553    }
    4654
    47     public ThreeDimensionalPacking(int assignedBin, int x, int y, int z) : this(assignedBin, x, y, z, false) {}
    48     public ThreeDimensionalPacking(int assignedBin, int x, int y, int z, bool rotated)
     55    public ThreeDimensionalPacking(int assignedBin, int x, int y, int z, bool rotated = false)
    4956      : base(assignedBin, rotated) {
    50       this.X = x;
    51       this.Y = y;
    52       this.Z = z;
     57      this.x = x;
     58      this.y = y;
     59      this.z = z;
    5360    }
     61
    5462    public override string ToString() {
    55       StringBuilder sb = new StringBuilder();
    56       sb.Append("[");
    57       sb.Append("AssignedBin: ");
    58       sb.Append(AssignedBin);
    59       sb.Append("; (");
    60       sb.Append(X + ",");
    61       sb.Append(Y + ",");
    62       sb.Append(Z);
    63       sb.Append(")");
    64       sb.Append("]");
    65       return sb.ToString();
     63      return string.Format("[AssignedBin: {0}; ({1},{2},{3})]", AssignedBin, X, Y, Z);
    6664    }
    6765
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Dimensions/TwoDimensionalPacking.cs

    r13032 r13605  
    2828  [Item("Two Dimensional Packing", "Represents a packing-position associated with a two dimensional packing-problem.")]
    2929  [StorableClass]
     30  // TwoDimensionalPacking is an immutable class (and handled as value type concerning Equals and GetHashCode())
    3031  public class TwoDimensionalPacking : PackingDimensions {
    31     public int X { get; set; }
    32     public int Y { get; set; }
     32    [Storable]
     33    private readonly int x;
     34    public int X { get { return x; } }
     35
     36    [Storable]
     37    private readonly int y;
     38    public int Y { get { return y; } }
    3339
    3440    [StorableConstructor]
     
    3642    protected TwoDimensionalPacking(TwoDimensionalPacking original, Cloner cloner)
    3743      : base(original, cloner) {
    38         X = original.X;
    39         Y = original.Y;
     44      x = original.X;
     45      y = original.Y;
    4046    }
     47
     48    public TwoDimensionalPacking(int assignedBin, int x, int y, bool rotated = false)
     49      : base(assignedBin, rotated) {
     50      this.x = x;
     51      this.y = y;
     52    }
     53
    4154    public override IDeepCloneable Clone(Cloner cloner) {
    4255      return new TwoDimensionalPacking(this, cloner);
    4356    }
    44 
    45     public TwoDimensionalPacking(int assignedBin, int x, int y) : this(assignedBin, x, y, false) { }
    46     public TwoDimensionalPacking(int assignedBin, int x, int y, bool rotated)
    47       : base(assignedBin, rotated) {
    48       this.X = x;
    49       this.Y = y;
    50     }
     57   
    5158    public override string ToString() {
    52       StringBuilder sb = new StringBuilder();
    53       sb.Append("[");
    54       sb.Append("AssignedBin: ");
    55       sb.Append(AssignedBin);
    56       sb.Append("; (");
    57       sb.Append(X + ",");
    58       sb.Append(Y);
    59       sb.Append(")");
    60       sb.Append("]");
    61       return sb.ToString();
     59      return string.Format("[AssignedBin: {0}; ({1},{2})]", AssignedBin, x, y);
    6260    }
    6361
    64 
    6562    public override bool Equals(object obj) {
    66       var tdp = obj as TwoDimensionalPacking;
    67       if (tdp != null)
    68         return (tdp.X == this.X && tdp.Y == this.Y);
     63      var other = obj as TwoDimensionalPacking;
     64      if (other != null)
     65        return (other.X == this.X && other.Y == this.Y && base.Equals(other));
    6966      else return false;
    7067    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking.cs

    r13578 r13605  
    101101        double result = 0;
    102102        foreach (var entry in ItemMeasures)
    103           result += entry.Value.MultipliedMeasures;
    104         result /= BinMeasures.MultipliedMeasures;
     103          result += entry.Value.Volume;
     104        result /= BinMeasures.Volume;
    105105        return result;
    106106      }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/Abstract/BinUtilizationRegularIdenticalBinEvaluator.cs

    r13032 r13605  
    8787
    8888      for (int i = 0; i < nrOfBins; i++) {
    89         double usableSpace = plan.BinPackings[i].BinMeasures.MultipliedMeasures;
     89        double usableSpace = plan.BinPackings[i].BinMeasures.Volume;
    9090        //var indexes = plan.PackingItemPositions.Select((Value, Index) => new { Value, Index }).Where(s => s.Value.Value.AssignedBin == i).Select(s => s.Index);
    9191        //var packedItemsInThisBin = plan.PackingItemMeasures.Select((Value, Index) => new { Value, Index }).Where(s => indexes.Contains(s.Index));
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj

    r13461 r13605  
    287287    <Compile Include="Interfaces\I2DOperator.cs" />
    288288    <Compile Include="Interfaces\IPackingMove.cs" />
    289     <Compile Include="Interfaces\IPotvinOperator.cs" />
    290289    <Compile Include="Interfaces\IMultiComponentVectorMoveOperator.cs" />
    291290    <Compile Include="Interfaces\IGroupingVectorMoveOperator.cs" />
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/I2DOperator.cs

    r13032 r13605  
    2020#endregion
    2121
    22 
    2322namespace HeuristicLab.Problems.BinPacking.Interfaces {
    2423  public interface I2DOperator {
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/I3DOperator.cs

    r13032 r13605  
    2020#endregion
    2121
    22 
    2322namespace HeuristicLab.Problems.BinPacking.Interfaces {
    2423  public interface I3DOperator {
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/IPackingBin.cs

    r13032 r13605  
    2222
    2323namespace HeuristicLab.Problems.BinPacking.Interfaces {
    24   public interface IPackingBin : IPackingShape {
    25   }
     24  // a packing bin represents the container for a packing solution
     25  public interface IPackingBin : IPackingShape { }
    2626}
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/IPackingDimensions.cs

    r13032 r13605  
    2020#endregion
    2121
    22 using System;
    2322using HeuristicLab.Core;
    2423
    2524namespace HeuristicLab.Problems.BinPacking.Interfaces {
     25  // TODO: this interface should contain positions
    2626  public interface IPackingDimensions : IItem {
    27     Int32 AssignedBin { get; }
     27    int AssignedBin { get; }
    2828    bool Rotated { get; }
    2929  }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/IPackingItem.cs

    r13032 r13605  
    2020#endregion
    2121
    22 
    2322namespace HeuristicLab.Problems.BinPacking.Interfaces {
     23  // a packing item is one of the items that needs to be located in one of the packing bins (containers)
    2424  public interface IPackingItem : IPackingShape {
    25     void AddTargetBinMeasures(int[] targetBinMeasures);
    2625    double Weight { get; set; }
    2726    int Material { get; set; }
    2827    /// <summary>
    29     /// Returns if the "other" item can be stacked on this item.
     28    /// Returns true if the "other" item can be stacked on this item.
    3029    /// </summary>
    3130    /// <param name="other"></param>
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/IPackingPlan.cs

    r13462 r13605  
    2323
    2424namespace HeuristicLab.Problems.BinPacking.Interfaces {
     25  // represents a packing solution (either 2d or 3d)
    2526  public interface IPackingPlan : IItem {
    2627    int NrOfBins { get; }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/IPackingShape.cs

    r13461 r13605  
    2323
    2424namespace HeuristicLab.Problems.BinPacking.Interfaces {
    25   public interface IPackingShape : IItem {
    26   }
     25  // a packing shape represents a physical object of correct dimension (2d or 3d)
     26  // packing bins (containers) and packing items are both packing shapes
     27  public interface IPackingShape : IItem { }
    2728}
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/IRegularPackingShape.cs

    r13032 r13605  
    2525  ///A regularPackingShape has special geometric properties that allow special handling = Rectangle, Cuboid
    2626  public interface IRegularPackingShape : IPackingShape, IComparable {
    27     int MultipliedMeasures { get; }
     27    int Volume { get; }
    2828    void ApplyHorizontalOrientation();
    2929  }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingItem/CuboidPackingItem.cs

    r13574 r13605  
    3434  [StorableClass]
    3535  public class CuboidPackingItem : CuboidPackingShape, IPackingItem {
     36    public IValueParameter<CuboidPackingBin> TargetBinParameter {
     37      get { return (IValueParameter<CuboidPackingBin>)Parameters["TargetBin"]; }
     38    }
     39    public IFixedValueParameter<DoubleValue> WeightParameter {
     40      get { return (IFixedValueParameter<DoubleValue>)Parameters["Weight"]; }
     41    }
     42    public IFixedValueParameter<IntValue> MaterialParameter {
     43      get { return (IFixedValueParameter<IntValue>)Parameters["Material"]; }
     44    }
     45
    3646    public CuboidPackingBin TargetBin {
    37       get { return ((IValueParameter<CuboidPackingBin>)Parameters["TargetBin"]).Value; }
    38       set { ((IValueParameter<CuboidPackingBin>)Parameters["TargetBin"]).Value = value; }
     47      get { return TargetBinParameter.Value; }
     48      set { TargetBinParameter.Value = value; }
    3949    }
    4050
    4151    public double Weight {
    42       get { return ((IFixedValueParameter<DoubleValue>)Parameters["Weight"]).Value.Value; }
    43       set { ((IFixedValueParameter<DoubleValue>)Parameters["Weight"]).Value.Value = value; }
     52      get { return WeightParameter.Value.Value; }
     53      set { WeightParameter.Value.Value = value; }
    4454    }
    4555
    4656    public int Material {
    47       get { return ((IFixedValueParameter<IntValue>)Parameters["Material"]).Value.Value; }
    48       set { ((IFixedValueParameter<IntValue>)Parameters["Material"]).Value.Value = value; }
     57      get { return MaterialParameter.Value.Value; }
     58      set { MaterialParameter.Value.Value = value; }
    4959    }
    5060
     
    5767    protected CuboidPackingItem(CuboidPackingItem original, Cloner cloner)
    5868      : base(original, cloner) {
     69      RegisterEvents();
    5970    }
    6071    public CuboidPackingItem()
     
    6374      Parameters.Add(new FixedValueParameter<DoubleValue>("Weight"));
    6475      Parameters.Add(new FixedValueParameter<IntValue>("Material"));
     76
     77      RegisterEvents();
    6578    }
    6679
     
    8396    }
    8497
     98    [StorableHook(HookType.AfterDeserialization)]
     99    private void AfterDeserialization() {
     100      RegisterEvents();
     101    }
     102
    85103    public override IDeepCloneable Clone(Cloner cloner) {
    86104      return new CuboidPackingItem(this, cloner);
    87105    }
    88106
    89     public void AddTargetBinMeasures(int[] targetBinMeasures) {
    90       TargetBin = new CuboidPackingBin(targetBinMeasures[0], targetBinMeasures[1], targetBinMeasures[2]);
     107    private void RegisterEvents() {
     108      // only because of ToString override
     109      WeightParameter.Value.ValueChanged += (sender, args) => OnToStringChanged();
     110      MaterialParameter.Value.ValueChanged += (sender, args) => OnToStringChanged();
     111
     112      // target bin does not occur in ToString()
    91113    }
    92114
     115
    93116    public override string ToString() {
    94       return String.Format("CuboidPackingItem ({0}, {1}, {2}; w={3}, m={4})", this.Width, this.Height, this.Depth, this.Weight, this.Material);
     117      return string.Format("CuboidPackingItem ({0}, {1}, {2}; weight={3}, mat={4})", this.Width, this.Height, this.Depth, this.Weight, this.Material);
    95118    }
    96119  }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingItem/RectangularPackingItem.cs

    r13574 r13605  
    7777      return ((other.Material < this.Material) || (other.Material.Equals(this.Material) && other.Weight <= this.Weight));
    7878    }
    79 
    80     public void AddTargetBinMeasures(int[] targetBinMeasures) {
    81       TargetBin = new RectangularPackingBin(targetBinMeasures[0], targetBinMeasures[1]);
    82     }
    8379  }
    8480}
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/BinPackingProblem.cs

    r13032 r13605  
    8686    }
    8787
    88 
    89 
    90 
    91     #region Helpers         
    9288    protected abstract void InitializeDecoder();
    9389    protected abstract void InitializeProblemInstance();
    9490    protected abstract void InitializeOperators();
    9591    protected abstract void InitializeEventHandlers();
    96     #endregion
    9792  }
    9893}
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/RegularIdenticalBinPackingProblem.cs

    r13461 r13605  
    112112    private int CalculateLowerBound() {
    113113      //This is the obvious continuous lower bound calculation; Martello and Vigo proposed a better way but it has not been implemented yet;
    114       int items = PackingItemMeasures.Select(x => x.MultipliedMeasures).Sum();
    115       int bin = PackingBinMeasures.MultipliedMeasures;
     114      int items = PackingItemMeasures.Select(x => x.Volume).Sum();
     115      int bin = PackingBinMeasures.Volume;
    116116      return (items + bin - 1)/(bin);
    117117    }
     
    229229    #region Problem instance handling
    230230    public virtual void Load(BPPData data) {
    231       var realData = data as RealBPPData;
    232       var binData = new B();
    233       binData.InitializeFromMeasures (data.BinMeasures);
    234 
    235       var itemData = new ItemList<I>(data.Items);
    236       for (int j = 0; j < data.Items; j++) {
    237         var item = new I();
    238         item.InitializeFromMeasures(data.ItemMeasures[j]);
    239         item.AddTargetBinMeasures(data.BinMeasures);
    240         if (realData != null) {
    241           item.Weight = realData.ItemWeights[j];
    242           item.Material = realData.ItemMaterials[j];
    243         }
    244         itemData.Add(item);
    245       }
    246 
    247       BestKnownQuality = data.BestKnownQuality.HasValue ? new DoubleValue(data.BestKnownQuality.Value) : null;
    248 
    249       PackingBinMeasures = binData;   
    250       PackingItemMeasures = itemData;
    251 
    252       ApplyHorizontalOrientation();
    253       SortItems();
    254       PackingItemsParameter.Value.Value = PackingItemMeasures.Count;
    255       LowerBoundParameter.Value.Value = CalculateLowerBound();
     231      // var realData = data as RealBPPData;
     232      // var binData = new B();
     233      // binData.InitializeFromMeasures (data.BinMeasures);
     234      //
     235      // var itemData = new ItemList<I>(data.Items);
     236      // for (int j = 0; j < data.Items; j++) {
     237      //   var item = new I();
     238      //   item.InitializeFromMeasures(data.ItemMeasures[j]);
     239      //   item.AddTargetBinMeasures(data.BinMeasures);
     240      //   if (realData != null) {
     241      //     item.Weight = realData.ItemWeights[j];
     242      //     item.Material = realData.ItemMaterials[j];
     243      //   }
     244      //   itemData.Add(item);
     245      // }
     246      //
     247      // BestKnownQuality = data.BestKnownQuality.HasValue ? new DoubleValue(data.BestKnownQuality.Value) : null;
     248      //
     249      // PackingBinMeasures = binData;   
     250      // PackingItemMeasures = itemData;
     251      //
     252      // ApplyHorizontalOrientation();
     253      // SortItems();
     254      // PackingItemsParameter.Value.Value = PackingItemMeasures.Count;
     255      // LowerBoundParameter.Value.Value = CalculateLowerBound();
     256
     257      throw new NotImplementedException();
    256258    }
    257259
    258260    public BPPData Export() {
    259       var result = new BPPData{
    260         Name = Name,
    261         Description = Description,
    262         Items = PackingItemsParameter.Value.Value,
    263         BinMeasures = PackingBinMeasures.ToArray()
    264       };
    265 
    266       var itemMeasures = new int[result.Items][];
    267       int i = 0;
    268       foreach (var item in PackingItemMeasures) {
    269         itemMeasures[i] = item.ToArray();
    270         i++;
    271       }
    272       result.ItemMeasures = itemMeasures;
    273       return result;
     261      // var result = new BPPData{
     262      //   Name = Name,
     263      //   Description = Description,
     264      //   Items = PackingItemsParameter.Value.Value,
     265      //   BinMeasures = PackingBinMeasures.ToArray() // TODO: split functionality of class in 2d and 3d code
     266      // };
     267      //
     268      // var itemMeasures = new int[result.Items][];
     269      // int i = 0;
     270      // foreach (var item in PackingItemMeasures) {
     271      //   itemMeasures[i] = item.ToArray();
     272      //   i++;
     273      // }
     274      // result.ItemMeasures = itemMeasures;
     275      // return result;
     276
     277      throw new NotImplementedException();
    274278    }
    275279    #endregion
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/CuboidPackingShape.cs

    r13574 r13605  
    2121
    2222using System;
    23 using System.Diagnostics;
    2423using HeuristicLab.Problems.BinPacking.Interfaces;
    2524using HeuristicLab.Core;
     
    3433  [StorableClass]
    3534  public abstract class CuboidPackingShape : PackingShape<ThreeDimensionalPacking>, IRegularPackingShape, IComparable<CuboidPackingShape> {
    36     #region Properties
     35    public IFixedValueParameter<IntValue> HeightParameter {
     36      get { return (IFixedValueParameter<IntValue>)Parameters["Height"]; }
     37    }
     38    public IFixedValueParameter<IntValue> WidthParameter {
     39      get { return (IFixedValueParameter<IntValue>)Parameters["Width"]; }
     40    }
     41    public IFixedValueParameter<IntValue> DepthParameter {
     42      get { return (IFixedValueParameter<IntValue>)Parameters["Depth"]; }
     43    }
     44
    3745    public int Height {
    38       get { return ((IFixedValueParameter<IntValue>)Parameters["Height"]).Value.Value; }
    39       set { ((IFixedValueParameter<IntValue>)Parameters["Height"]).Value.Value = value; }
     46      get { return HeightParameter.Value.Value; }
     47      set { HeightParameter.Value.Value = value; }
    4048    }
    4149
    4250    public int Width {
    43       get { return ((IFixedValueParameter<IntValue>)Parameters["Width"]).Value.Value; }
    44       set { ((IFixedValueParameter<IntValue>)Parameters["Width"]).Value.Value = value; }
     51      get { return WidthParameter.Value.Value; }
     52      set { WidthParameter.Value.Value = value; }
    4553    }
    4654
    4755    public int Depth {
    48       get { return ((IFixedValueParameter<IntValue>)Parameters["Depth"]).Value.Value; }
    49       set { ((IFixedValueParameter<IntValue>)Parameters["Depth"]).Value.Value = value; }
     56      get { return DepthParameter.Value.Value; }
     57      set { DepthParameter.Value.Value = value; }
     58    }
     59
     60    [StorableConstructor]
     61    protected CuboidPackingShape(bool deserializing) : base(deserializing) { }
     62    protected CuboidPackingShape(CuboidPackingShape original, Cloner cloner)
     63      : base(original, cloner) {
     64      RegisterEvents();
     65    }
     66    protected CuboidPackingShape()
     67      : base() {
     68      Parameters.Add(new FixedValueParameter<IntValue>("Width"));
     69      Parameters.Add(new FixedValueParameter<IntValue>("Height"));
     70      Parameters.Add(new FixedValueParameter<IntValue>("Depth"));
     71
     72      RegisterEvents();
     73    }
     74
     75    protected CuboidPackingShape(int width, int height, int depth)
     76      : this() {
     77      this.Width = width;
     78      this.Height = height;
     79      this.Depth = depth;
     80    }
     81
     82    [StorableHook(HookType.AfterDeserialization)]
     83    private void AfterDeserialization() {
     84      RegisterEvents();
     85    }
     86
     87    private void RegisterEvents() {
     88      // only because of ToString override
     89      HeightParameter.Value.ValueChanged += (sender, args) => OnToStringChanged();
     90      WidthParameter.Value.ValueChanged += (sender, args) => OnToStringChanged();
     91      DepthParameter.Value.ValueChanged += (sender, args) => OnToStringChanged();
     92    }
     93
     94    public override string ToString() {
     95      return String.Format("CuboidPackingShape ({0}, {1}, {2})", this.Width, this.Height, this.Depth);
     96    }
     97
     98    #region IComparable Members
     99
     100    public int CompareTo(CuboidPackingShape other) {
     101      //Using "Clustered-Area-Height"-comparison as descr
     102
     103      int result = (this.Width * this.Depth).CompareTo(other.Width * other.Depth);
     104
     105      if (result == 0)
     106        result = this.Volume.CompareTo(other.Volume);
     107      if (result == 0)
     108        result = this.Height.CompareTo(other.Height);
     109      return result;
     110    }
     111
     112    public int CompareTo(object obj) {
     113      var other = (CuboidPackingShape)obj;
     114      if (other != null) return CompareTo(other);
     115      else throw new ArgumentException(string.Format("Cannot compare with object {0}", obj), "obj");
    50116    }
    51117
    52118    #endregion
    53119
     120    private struct CuboidDiagonal {
     121      public int x1;
     122      public int y1;
     123      public int z1;
     124      public int x2;
     125      public int y2;
     126      public int z2;
     127      public CuboidDiagonal(CuboidPackingShape myShape) : this(new ThreeDimensionalPacking(0, 0, 0, 0), myShape) { }
     128      public CuboidDiagonal(ThreeDimensionalPacking myPosition, CuboidPackingShape myShape) {
     129        x1 = myPosition.X;
     130        y1 = myPosition.Y;
     131        z1 = myPosition.Z;
     132        x2 = myPosition.X + (myPosition.Rotated ? myShape.Depth : myShape.Width) - 1;
     133        y2 = myPosition.Y + myShape.Height - 1;
     134        z2 = myPosition.Z + (myPosition.Rotated ? myShape.Width : myShape.Depth) - 1;
     135      }
     136    }
     137
     138
    54139    #region Helpers
    55140    public override ThreeDimensionalPacking Origin { get { return new ThreeDimensionalPacking(0, 0, 0, 0); } }
    56     public override int MultipliedMeasures { get { return Width * Height * Depth; } }
     141    public override int Volume { get { return Width * Height * Depth; } }
    57142
    58143    public override bool EnclosesPoint(ThreeDimensionalPacking myPosition, ThreeDimensionalPacking checkedPoint) {
     
    103188    #endregion
    104189
    105 
    106 
    107     public override void InitializeFromMeasures(int[] measures) {
    108       if (measures.Length != 3)
    109         throw new InvalidOperationException("Nr of measures does not fit shape-dimension.");
    110       this.Width = measures[0];
    111       this.Height = measures[1];
    112       this.Depth = measures[2];
    113     }
    114     public override int[] ToArray() {
    115       return new int[] { Width, Height, Depth };
    116     }
    117 
    118 
    119     protected CuboidPackingShape()
    120       : base() {
    121       Parameters.Add(new FixedValueParameter<IntValue>("Width"));
    122       Parameters.Add(new FixedValueParameter<IntValue>("Height"));
    123       Parameters.Add(new FixedValueParameter<IntValue>("Depth"));
    124     }
    125 
    126     protected CuboidPackingShape(int width, int height, int depth)
    127       : this() {
    128       this.Width = width;
    129       this.Height = height;
    130       this.Depth = depth;
    131     }
    132 
    133     [StorableConstructor]
    134     protected CuboidPackingShape(bool deserializing) : base(deserializing) { }
    135     protected CuboidPackingShape(CuboidPackingShape original, Cloner cloner)
    136       : base(original, cloner) {
    137     }
    138 
    139     public override string ToString() {
    140       return String.Format("CuboidPackingShape ({0}, {1}, {2})", this.Width, this.Height, this.Depth);
    141     }
    142 
    143     #region IComparable Members
    144 
    145     public int CompareTo(CuboidPackingShape other) {
    146       //Using "Clustered-Area-Height"-comparison as descr
    147 
    148       int result = (this.Width * this.Depth).CompareTo(other.Width * other.Depth);
    149 
    150       if (result == 0)
    151         result = this.MultipliedMeasures.CompareTo(other.MultipliedMeasures);
    152       if (result == 0)
    153         result = this.Height.CompareTo(other.Height);
    154       return result;
    155     }
    156 
    157     public int CompareTo(object obj) {
    158       var other = (CuboidPackingShape)obj;
    159       if (other != null) return CompareTo(other);
    160       else throw new ArgumentException(string.Format("Cannot compare with object {0}", obj), "obj");
    161     }
    162 
    163     #endregion
    164 
    165     private struct CuboidDiagonal {
    166       public int x1;
    167       public int y1;
    168       public int z1;
    169       public int x2;
    170       public int y2;
    171       public int z2;
    172       public CuboidDiagonal(CuboidPackingShape myShape) : this(new ThreeDimensionalPacking(0, 0, 0, 0), myShape) { }
    173       public CuboidDiagonal(ThreeDimensionalPacking myPosition, CuboidPackingShape myShape) {
    174         x1 = myPosition.X;
    175         y1 = myPosition.Y;
    176         z1 = myPosition.Z;
    177         x2 = myPosition.X + (myPosition.Rotated ? myShape.Depth : myShape.Width) - 1;
    178         y2 = myPosition.Y + myShape.Height - 1;
    179         z2 = myPosition.Z + (myPosition.Rotated ? myShape.Width : myShape.Depth) - 1;
    180       }
    181     }
    182190  }
    183191}
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/PackingShape.cs

    r13574 r13605  
    4242    public abstract bool Encloses(T checkedPosition, PackingShape<T> checkedShape);
    4343    public abstract bool Overlaps(T myPosition, T checkedPosition, PackingShape<T> checkedShape);
    44     public abstract void InitializeFromMeasures(int[] measures);
    45     public abstract int[] ToArray();
    46     public abstract int MultipliedMeasures { get; }
     44    public abstract int Volume { get; }
    4745    public abstract T Origin { get; }
    4846
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/RectangularPackingShape.cs

    r13574 r13605  
    3434  [StorableClass]
    3535  public abstract class RectangularPackingShape : PackingShape<TwoDimensionalPacking>, IRegularPackingShape, IComparable<RectangularPackingShape> {
    36     #region Properties
    3736    public int Height {
    3837      get { return ((IFixedValueParameter<IntValue>)Parameters["Height"]).Value.Value; }
     
    4544    }
    4645
    47     #endregion
    48 
     46    [StorableConstructor]
     47    protected RectangularPackingShape(bool deserializing) : base(deserializing) { }
     48    protected RectangularPackingShape(RectangularPackingShape original, Cloner cloner)
     49      : base(original, cloner) {
     50    }
    4951    protected RectangularPackingShape()
    5052      : base() {
     
    5759      this.Width = width;
    5860    }
    59 
    60     [StorableConstructor]
    61     protected RectangularPackingShape(bool deserializing) : base(deserializing) { }
    62     protected RectangularPackingShape(RectangularPackingShape original, Cloner cloner)
    63       : base(original, cloner) {
    64     }
    65 
    66     public override void InitializeFromMeasures(int[] measures) {
    67       if (measures.Length != 2)
    68         throw new InvalidOperationException("Nr of measures does not fit shape-dimension.");
    69       this.Width = measures[0];
    70       this.Height = measures[1];
    71     }
    72 
    73 
    7461
    7562    public override string ToString() {
     
    9481    #endregion
    9582
    96     public override int[] ToArray() {
    97       return new int[] { Width, Height };
    98     }
    99 
    100 
    10183
    10284    #region Helpers
    10385    public override TwoDimensionalPacking Origin { get { return new TwoDimensionalPacking(0, 0, 0); } }
    104     public override int MultipliedMeasures { get { return Height * Width; } }
     86    public override int Volume { get { return Height * Width; } }
    10587
    10688    public override bool EnclosesPoint(TwoDimensionalPacking myPosition, TwoDimensionalPacking checkedPoint) {
Note: See TracChangeset for help on using the changeset viewer.