Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weight equally good solutions by some metric #68

Open
ModischFabrications opened this issue Mar 30, 2024 · 5 comments
Open

Weight equally good solutions by some metric #68

ModischFabrications opened this issue Mar 30, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@ModischFabrications
Copy link
Owner

There are often solutions with identical trimmings. Current code just picks one at random, but there could be a setting to prioritize based on secondary metrics.

  1. Most cuts of the same length in a row
  2. largest trimmings at once / largest distribution of trimmings
  3. ..?
@ModischFabrications
Copy link
Owner Author

Only relevant for bruteforce! Other solvers won't look for other solutions

ModischFabrications added a commit that referenced this issue Mar 30, 2024
…ecks, simplify tests with matrixes, remove cumbersome test fixtures, use simple typing, create and update SolverSettings, rework n_max checks to properly respect calculation times, major performance upgrade to bruteforce solver (closes #66), fix and include gapfill solver, prepare structure for #68 metrics
ModischFabrications added a commit that referenced this issue Mar 30, 2024
…ecks, simplify tests with matrixes, remove cumbersome test fixtures, use simple typing, create and update SolverSettings, rework n_max checks to properly respect calculation times, major performance upgrade to bruteforce solver (closes #66), fix and include gapfill solver, prepare structure for #68 metrics
ModischFabrications added a commit that referenced this issue Mar 30, 2024
…ecks, simplify tests with matrixes, remove cumbersome test fixtures, use simple typing, create and update SolverSettings, rework n_max checks to properly respect calculation times, major performance upgrade to bruteforce solver (closes #66), fix and include gapfill solver, prepare structure for #68 metrics
@ModischFabrications
Copy link
Owner Author

For #52 : Could prioritize solutions that use less infinite material with equal trimmings

@ModischFabrications
Copy link
Owner Author

#52: Sort by fewest leftovers, e.g. with a min_cutoff_length or similar.

@ModischFabrications
Copy link
Owner Author

Side-effect of trimming only solvers, can't really be caught at the moment:

required = [500:1, 100:1]
stocks = [900, 100:1]

A human would just pick the 100 stock and pass it on, but the solver is going to use 500+100 to minimize trimmings. This is mathematically more efficient because 300 trimmings with 1 stock is less than 400 trimmings on 2.

Future solvers could optimize for number of cuts and/or have adaptive weights based on {longest trimming, sum of trimmings, number of cuts, ...} instead, which would catch this, but could potentially leave more (but more usable) trimmings.

@ModischFabrications ModischFabrications added the enhancement New feature or request label Apr 15, 2024
@ModischFabrications
Copy link
Owner Author

nice to have: smarter ratings based on weights:

  1. Equal stocks higher than <10% trimmings difference
  2. the number of cuts
  3. infinite
  4. pattern reuse, ...
Bad solution

{
  "job": {
    "cut_width": 20,
    "stocks": [
      {
        "length": 2400,
        "name": "138200",
        "quantity": 1
      },
      {
        "length": 6000,
        "name": "138318",
        "quantity": 1
      }
    ],
    "required": [
      {
        "length": 1820,
        "quantity": 1
      },
      {
        "length": 666,
        "quantity": 3
      }
    ]
  },
  "solver_type": "bruteforce",
  "time_us": 473,
  "layout": [
    {
      "stock": {
        "length": 2400,
        "name": "138200"
      },
      "cuts": [
        {
          "length": 666
        }
      ],
      "trimming": 1714
    },
    {
      "stock": {
        "length": 6000,
        "name": "138318"
      },
      "cuts": [
        {
          "length": 1820
        },
        {
          "length": 666
        },
        {
          "length": 666
        }
      ],
      "trimming": 2788
    }
  ]
}

-> In the result both stock items are used, where it would be more efficient if all items were cut from the second stock item. It doesn't make a difference in waste, but a lot in handling.

ModischFabrications added a commit that referenced this issue May 6, 2024
…est results to skip duplicates, sort results by biggest trimmings; update and fix tests, add test for #68; update v1.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant