Rev | Line | |
---|
[15463] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Threading.Tasks;
|
---|
| 6 |
|
---|
| 7 | namespace HeuristicLab.Problems.BinPacking3D.Packer {
|
---|
| 8 |
|
---|
| 9 | /// <summary>
|
---|
| 10 | /// This class can be used for creating bin packer insances
|
---|
| 11 | /// </summary>
|
---|
| 12 | public static class BinPackerFactory {
|
---|
| 13 |
|
---|
| 14 | /// <summary>
|
---|
| 15 | /// Returns the bin packer depending on the given fitting method
|
---|
| 16 | /// </summary>
|
---|
| 17 | /// <param name="fittingMethod"></param>
|
---|
[15471] | 18 | /// <returns>Returns a new BinPacker depending on the given fitting method</returns>
|
---|
[15463] | 19 | public static BinPacker CreateBinPacker(FittingMethod fittingMethod) {
|
---|
| 20 | BinPacker binPacker = null;
|
---|
| 21 | switch (fittingMethod) {
|
---|
| 22 | case FittingMethod.FirstFit:
|
---|
| 23 | binPacker = new BinPackerFirstFit();
|
---|
| 24 | break;
|
---|
| 25 | case FittingMethod.FreeVolumeBestFit:
|
---|
| 26 | binPacker = new BinPackerFreeVolumeBestFit();
|
---|
| 27 | break;
|
---|
| 28 | case FittingMethod.ResidualSpaceBestFit:
|
---|
| 29 | binPacker = new BinPackerResidualSpaceBestFit();
|
---|
| 30 | break;
|
---|
| 31 | default:
|
---|
| 32 | throw new ArgumentException("Unknown fitting method: " + fittingMethod);
|
---|
| 33 | }
|
---|
| 34 | return binPacker;
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.