Changeset 13607 for branches/HeuristicLab.BinPacking
- Timestamp:
- 02/08/16 21:13:43 (9 years ago)
- Location:
- branches/HeuristicLab.BinPacking
- Files:
-
- 2 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Decoders/BL/BottomLeftGroupingVectorDecoder.cs
r13032 r13607 30 30 using HeuristicLab.Problems.BinPacking.Interfaces; 31 31 using HeuristicLab.Encodings.PackingEncoding.GroupingVector; 32 using HeuristicLab.Problems.BinPacking2D; 32 33 33 34 namespace HeuristicLab.Problems.BinPacking.Decoders { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Decoders/BL/BottomLeftPackingSequenceDecoder.cs
r13032 r13607 31 31 using HeuristicLab.Encodings.PackingEncoding.PackingSequence; 32 32 using HeuristicLab.Problems.BinPacking.Interfaces; 33 using HeuristicLab.Problems.BinPacking2D; 33 34 34 35 namespace HeuristicLab.Problems.BinPacking.Decoders { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Decoders/EP/ExtremePointGroupingVectorDecoder2D.cs
r13032 r13607 31 31 using HeuristicLab.Problems.BinPacking.Interfaces; 32 32 using HeuristicLab.Encodings.PackingEncoding.GroupingVector; 33 using HeuristicLab.Problems.BinPacking2D; 33 34 34 35 namespace HeuristicLab.Problems.BinPacking.Decoders { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Decoders/EP/ExtremePointMultiComponentVectorDecoder2D.cs
r13032 r13607 30 30 using HeuristicLab.Problems.BinPacking.Interfaces; 31 31 using HeuristicLab.Encodings.PackingEncoding.MultiComponentVector; 32 using HeuristicLab.Problems.BinPacking2D; 32 33 33 34 namespace HeuristicLab.Problems.BinPacking.Decoders { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Decoders/EP/ExtremePointPackingSequenceDecoder2D.cs
r13032 r13607 31 31 using HeuristicLab.Encodings.PackingEncoding.PackingSequence; 32 32 using HeuristicLab.Problems.BinPacking.Interfaces; 33 using HeuristicLab.Problems.BinPacking2D; 33 34 34 35 namespace HeuristicLab.Problems.BinPacking.Decoders { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/HeuristicLab.Problems.BinPacking2D-3.3.csproj
r13606 r13607 171 171 <Compile Include="MoveEvaluators\PackingMoveEvaluator2DMCV.cs" /> 172 172 <Compile Include="MoveEvaluators\PackingMoveEvaluator2DPS.cs" /> 173 <Compile Include="PackingPlan2D.cs" /> 173 174 <Compile Include="PackingRatioRectangularIdenticalBinEvaluator.cs" /> 174 175 <Compile Include="Plugin.cs" /> … … 185 186 <None Include="Plugin.cs.frame" /> 186 187 </ItemGroup> 187 <ItemGroup /> 188 <ItemGroup> 189 <ProjectReference Include="..\..\HeuristicLab.Problems.BinPacking\3.3\HeuristicLab.Problems.BinPacking-3.3.csproj"> 190 <Project>{F8A55094-3CD5-4034-B0CA-5BD7FFB016D4}</Project> 191 <Name>HeuristicLab.Problems.BinPacking-3.3</Name> 192 </ProjectReference> 193 </ItemGroup> 188 194 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 189 195 <PropertyGroup> -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/Interfaces/I2DOperator.cs
r13606 r13607 20 20 #endregion 21 21 22 namespace HeuristicLab.Problems.BinPacking .Interfaces {22 namespace HeuristicLab.Problems.BinPacking2D.Interfaces { 23 23 public interface I2DOperator { 24 24 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/MoveEvaluators/PackingMoveEvaluator2DGV.cs
r13606 r13607 28 28 using HeuristicLab.Problems.BinPacking.PackingBin; 29 29 using HeuristicLab.Problems.BinPacking.PackingItem; 30 using HeuristicLab.Problems.BinPacking2D.Interfaces; 30 31 31 32 namespace HeuristicLab.Problems.BinPacking { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/MoveEvaluators/PackingMoveEvaluator2DMCV.cs
r13606 r13607 28 28 using HeuristicLab.Problems.BinPacking.PackingBin; 29 29 using HeuristicLab.Problems.BinPacking.PackingItem; 30 using HeuristicLab.Problems.BinPacking2D.Interfaces; 30 31 31 32 namespace HeuristicLab.Problems.BinPacking { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/MoveEvaluators/PackingMoveEvaluator2DPS.cs
r13606 r13607 28 28 using HeuristicLab.Problems.BinPacking.PackingBin; 29 29 using HeuristicLab.Problems.BinPacking.PackingItem; 30 using HeuristicLab.Problems.BinPacking2D.Interfaces; 30 31 31 32 namespace HeuristicLab.Problems.BinPacking { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking3D.cs
r13032 r13607 50 50 return new BinPacking3D(this, cloner); 51 51 } 52 52 53 53 protected override void GenerateNewExtremePointsForNewItem(CuboidPackingItem newItem, ThreeDimensionalPacking position) { 54 54 int newWidth = position.Rotated ? newItem.Depth : newItem.Width; … … 58 58 var sourcePointX = new ThreeDimensionalPacking(0, position.X + newWidth, position.Y, position.Z); 59 59 if (sourcePointX.X < BinMeasures.Width && sourcePointX.Y < BinMeasures.Height && sourcePointX.Z < BinMeasures.Depth) { 60 //Traversing down the y-axis 60 //Traversing down the y-axis 61 61 ThreeDimensionalPacking current = new ThreeDimensionalPacking(0, sourcePointX.X, sourcePointX.Y, sourcePointX.Z); 62 while (current.Y > 0 && !IsPointOccupied(ThreeDimensionalPacking.MoveDown 62 while (current.Y > 0 && !IsPointOccupied(ThreeDimensionalPacking.MoveDown(current))) { 63 63 current = ThreeDimensionalPacking.MoveDown(current); 64 64 } … … 69 69 ExtremePoints.Add(current); 70 70 71 //Traversing down the z-axis 71 //Traversing down the z-axis 72 72 current = new ThreeDimensionalPacking(0, sourcePointX.X, sourcePointX.Y, sourcePointX.Z); 73 while (current.Z > 0 && !IsPointOccupied(ThreeDimensionalPacking.MoveBack 73 while (current.Z > 0 && !IsPointOccupied(ThreeDimensionalPacking.MoveBack(current))) { 74 74 current = ThreeDimensionalPacking.MoveBack(current); 75 75 } … … 184 184 || IsPositionFeasible(measures, ThreeDimensionalPacking.MoveBack(currentPosition))) { 185 185 //Slide the item as far as possible to the left 186 187 186 while (IsPositionFeasible(measures, ThreeDimensionalPacking.MoveLeft(currentPosition)) 187 || IsPositionFeasible(measures, ThreeDimensionalPacking.MoveBack(currentPosition))) { 188 188 //Slide the item as far as possible to the back 189 189 while (IsPositionFeasible(measures, ThreeDimensionalPacking.MoveBack(currentPosition))) { … … 193 193 currentPosition = ThreeDimensionalPacking.MoveLeft(currentPosition); 194 194 } 195 196 195 if (IsPositionFeasible(measures, ThreeDimensionalPacking.MoveDown(currentPosition))) 196 currentPosition = ThreeDimensionalPacking.MoveDown(currentPosition); 197 197 } 198 198 199 199 return IsPositionFeasible(measures, currentPosition) ? currentPosition : null; 200 200 } 201 201 202 202 public override void SlidingBasedPacking(ref List<int> sequence, ItemList<CuboidPackingItem> itemMeasures) { 203 203 var temp = new List<int>(sequence); … … 244 244 } 245 245 } 246 246 247 247 public override int ShortestPossibleSideFromPoint(ThreeDimensionalPacking position) { 248 248 … … 255 255 return shortestSide; 256 256 257 ThreeDimensionalPacking current = new ThreeDimensionalPacking 257 ThreeDimensionalPacking current = new ThreeDimensionalPacking(0, position.X, position.Y, position.Z); 258 258 while (current.X < width && IsPointOccupied(current)) { current = ThreeDimensionalPacking.MoveRight(current); } 259 259 if (current.X - position.X < shortestSide) … … 262 262 263 263 current = new ThreeDimensionalPacking(0, position.X, position.Y, position.Z); 264 while (current.Y < height && IsPointOccupied(current)) { current = ThreeDimensionalPacking.MoveUp 264 while (current.Y < height && IsPointOccupied(current)) { current = ThreeDimensionalPacking.MoveUp(current); } 265 265 if (current.Y - position.Y < shortestSide) 266 266 shortestSide = current.Y - position.Y; … … 279 279 return true; 280 280 281 if (IsPointOccupied (new ThreeDimensionalPacking(0, position.X, position.Y - 1, position.Z))282 && IsPointOccupied (new ThreeDimensionalPacking (0, position.X + item.Width-1, position.Y - 1, position.Z))283 && IsPointOccupied (new ThreeDimensionalPacking (0, position.X, position.Y - 1, position.Z + item.Depth-1))284 && IsPointOccupied (new ThreeDimensionalPacking (0, position.X + item.Width-1, position.Y - 1, position.Z + item.Depth-1)))281 if (IsPointOccupied(new ThreeDimensionalPacking(0, position.X, position.Y - 1, position.Z)) 282 && IsPointOccupied(new ThreeDimensionalPacking(0, position.X + item.Width - 1, position.Y - 1, position.Z)) 283 && IsPointOccupied(new ThreeDimensionalPacking(0, position.X, position.Y - 1, position.Z + item.Depth - 1)) 284 && IsPointOccupied(new ThreeDimensionalPacking(0, position.X + item.Width - 1, position.Y - 1, position.Z + item.Depth - 1))) 285 285 return true; 286 286 … … 316 316 } 317 317 } 318 318 319 319 public bool IsSupportedByAtLeastOnePoint(CuboidPackingItem item, ThreeDimensionalPacking position) { 320 320 if (position.Y == 0) … … 326 326 if (IsPointOccupied(new ThreeDimensionalPacking(0, x, y, z))) 327 327 return true; 328 328 329 329 return false; 330 330 } … … 334 334 335 335 if (ItemMeasures[PointOccupation(new ThreeDimensionalPacking(0, ep.X, ep.Y - 1, ep.Z))].SupportsStacking(item) 336 && ItemMeasures[PointOccupation(new ThreeDimensionalPacking(0, ep.X + item.Width -1, ep.Y - 1, ep.Z))].SupportsStacking(item)337 && ItemMeasures[PointOccupation(new ThreeDimensionalPacking(0, ep.X, ep.Y - 1, ep.Z + item.Depth -1))].SupportsStacking(item)338 && ItemMeasures[PointOccupation(new ThreeDimensionalPacking(0, ep.X + item.Width -1, ep.Y - 1, ep.Z + item.Depth-1))].SupportsStacking(item))336 && ItemMeasures[PointOccupation(new ThreeDimensionalPacking(0, ep.X + item.Width - 1, ep.Y - 1, ep.Z))].SupportsStacking(item) 337 && ItemMeasures[PointOccupation(new ThreeDimensionalPacking(0, ep.X, ep.Y - 1, ep.Z + item.Depth - 1))].SupportsStacking(item) 338 && ItemMeasures[PointOccupation(new ThreeDimensionalPacking(0, ep.X + item.Width - 1, ep.Y - 1, ep.Z + item.Depth - 1))].SupportsStacking(item)) 339 339 return true; 340 340 341 341 return false; 342 } 343 342 } 343 344 344 345 345 protected override void InitializeOccupationLayers() { 346 for (int i = 0; i *10 <= BinMeasures.Depth; i += 1) {346 for (int i = 0; i * 10 <= BinMeasures.Depth; i += 1) { 347 347 OccupationLayers[i] = new List<int>(); 348 348 } … … 370 370 } 371 371 public class EPComparer3D : IComparer<ThreeDimensionalPacking> { 372 public int Compare(ThreeDimensionalPacking a, ThreeDimensionalPacking b) { 373 int result = a.Z.CompareTo(b.Z);372 public int Compare(ThreeDimensionalPacking a, ThreeDimensionalPacking b) { 373 int result = a.Z.CompareTo(b.Z); 374 374 if (result == 0) 375 result = a.X.CompareTo 375 result = a.X.CompareTo(b.X); 376 376 if (result == 0) 377 377 result = a.Y.CompareTo(b.Y); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/PackingPlan.cs
r13606 r13607 249 249 #endregion 250 250 } 251 252 253 254 255 256 257 258 251 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj
r13606 r13607 299 299 <SubType>Code</SubType> 300 300 </Compile> 301 <Compile Include="PackingPlan3D.cs" /> 301 302 <Compile Include="Problem\BinPackingProblem.cs" /> 302 303 <Compile Include="Problem\ISOContainerBinPackingProblem.cs" /> -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/CuboidIdenticalBinPackingProblem.cs
r13460 r13607 109 109 #region Helpers 110 110 protected override void InitializeDecoder() { 111 Operators.RemoveAll(op => op is I2DOperator);111 // Operators.RemoveAll(op => op is I2DOperator); TODO 112 112 113 113 PackingSolutionDecoderParameter.ValidValues.Clear(); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/ISOContainerBinPackingProblem.cs
r13460 r13607 170 170 #region Helpers 171 171 protected override void InitializeDecoder() { 172 Operators.RemoveAll(op => op is I2DOperator);172 // Operators.RemoveAll(op => op is I2DOperator); TODO 173 173 174 174 PackingSolutionDecoderParameter.ValidValues.Clear();
Note: See TracChangeset
for help on using the changeset viewer.