Changeset 13612


Ignore:
Timestamp:
02/08/16 21:38:13 (6 years ago)
Author:
gkronber
Message:

#1966: refactoring: core compiles

Location:
branches/HeuristicLab.BinPacking
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/BinPacking2D.cs

    r13606 r13612  
    3737    public BinPacking2D(RectangularPackingBin binMeasures)
    3838      : base(binMeasures) {
    39       //ExtremePoints = new HashSet<TwoDimensionalPacking>();
    4039      ExtremePoints = new SortedSet<TwoDimensionalPacking>(new EPComparer2D());
    4140      ExtremePoints.Add(binMeasures.Origin);
     
    5049      return new BinPacking2D(this, cloner);
    5150    }
    52                      
     51
    5352    protected override void GenerateNewExtremePointsForNewItem(RectangularPackingItem newItem, TwoDimensionalPacking position) {
    5453
     
    7372      if (sourcePointY.X < BinMeasures.Width && sourcePointY.Y < BinMeasures.Height) {
    7473        //Traversing down the x-axis 
    75         while (sourcePointY.X > 0 && !IsPointOccupied(new TwoDimensionalPacking (0,sourcePointY.X - 1, sourcePointY.Y))) {
     74        while (sourcePointY.X > 0 && !IsPointOccupied(new TwoDimensionalPacking(0, sourcePointY.X - 1, sourcePointY.Y))) {
    7675          sourcePointY.X--;
    7776        }
     
    111110        || IsPositionFeasible(measures, TwoDimensionalPacking.MoveDown(currentPosition))) {
    112111        //Slide the item as far as possible to the bottom
    113           while (IsPositionFeasible(measures, TwoDimensionalPacking.MoveDown(currentPosition))) {
    114             currentPosition = TwoDimensionalPacking.MoveDown(currentPosition);
    115         }
    116           if (IsPositionFeasible(measures, TwoDimensionalPacking.MoveLeft(currentPosition)))
     112        while (IsPositionFeasible(measures, TwoDimensionalPacking.MoveDown(currentPosition))) {
     113          currentPosition = TwoDimensionalPacking.MoveDown(currentPosition);
     114        }
     115        if (IsPositionFeasible(measures, TwoDimensionalPacking.MoveLeft(currentPosition)))
    117116          currentPosition = TwoDimensionalPacking.MoveLeft(currentPosition);
    118117      }
     
    120119      return IsPositionFeasible(measures, currentPosition) ? currentPosition : null;
    121120    }
    122    
     121
    123122    public override void SlidingBasedPacking(ref List<int> sequence, ItemList<RectangularPackingItem> itemMeasures) {
    124123      var temp = new List<int>(sequence);
     
    193192
    194193    protected override void InitializeOccupationLayers() {
    195       for (int i = 0; i*10 <= BinMeasures.Width; i += 1 ) {
     194      for (int i = 0; i * 10 <= BinMeasures.Width; i += 1) {
    196195        OccupationLayers[i] = new List<int>();
    197196      }
     
    207206      return OccupationLayers[position.X / 10];
    208207    }
    209     protected override List<int> GetLayerItemIDs(RectangularPackingItem measures, TwoDimensionalPacking position) { 
    210       List<int> result = new List<int> ();
     208    protected override List<int> GetLayerItemIDs(RectangularPackingItem measures, TwoDimensionalPacking position) {
     209      List<int> result = new List<int>();
    211210      int x1 = position.X / 10;
    212211      int x2 = (position.X + (position.Rotated ? measures.Height : measures.Width)) / 10;
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/BinPacking3D.cs

    r13608 r13612  
    3636    public BinPacking3D(CuboidPackingBin binMeasures)
    3737      : base(binMeasures) {
    38       //ExtremePoints = new HashSet<ThreeDimensionalPacking>();
    3938      ExtremePoints = new SortedSet<ThreeDimensionalPacking>(new EPComparer3D());
    4039      ExtremePoints.Add(binMeasures.Origin);
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/HeuristicLab.Problems.BinPacking.Views-3.3.csproj

    r13605 r13612  
    173173  </ItemGroup>
    174174  <ItemGroup>
     175    <ProjectReference Include="..\..\HeuristicLab.Problems.BinPacking.2D\3.3\HeuristicLab.Problems.BinPacking2D-3.3.csproj">
     176      <Project>{56dd7f51-3164-4c26-a97a-add6fe4b4e86}</Project>
     177      <Name>HeuristicLab.Problems.BinPacking2D-3.3</Name>
     178    </ProjectReference>
     179    <ProjectReference Include="..\..\HeuristicLab.Problems.BinPacking.3D\3.3\HeuristicLab.Problems.BinPacking3D-3.3.csproj">
     180      <Project>{95680c63-1e06-4e66-b33b-272a772321c7}</Project>
     181      <Name>HeuristicLab.Problems.BinPacking3D-3.3</Name>
     182    </ProjectReference>
    175183    <ProjectReference Include="..\..\HeuristicLab.Problems.BinPacking\3.3\HeuristicLab.Problems.BinPacking-3.3.csproj">
    176184      <Project>{F8A55094-3CD5-4034-B0CA-5BD7FFB016D4}</Project>
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlan2DView.cs

    r13578 r13612  
    2424using HeuristicLab.MainForm;
    2525using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
    26 using HeuristicLab.Problems.BinPacking.PackingItem;
    27 using HeuristicLab.Problems.BinPacking.PackingBin;
    28 using HeuristicLab.Problems.BinPacking.Dimensions;
    2926
    3027namespace HeuristicLab.Problems.BinPacking.Views {
Note: See TracChangeset for help on using the changeset viewer.