feat(engine): break equal-cost ties toward the larger free offcut

Without salvage credit (desktop Auto Nest on a single plate size) every
complete one-sheet layout costs the same, so engines kept whichever layout
came first. N26-23S nested 27.86" long when turning two parts fits it in
21.3".

NestJobCost.CompactnessOffcut measures the largest full-width/full-length
edge offcut as salvage does, whatever the salvage rate. Default and Circles
(CandidateScore), Rectangles and Circles sheet choice (SheetByStock) and
Irregular sheet and plan ranking use it only after cost, so no cost changes.
Sheet-level keys round to 1e-6 to keep ties platform-independent.

Rectangles layout digests are re-captured: each changed fixture keeps its
sheets, parts and cost and leaves a larger offcut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 5.5 committed 2026-10-24 20:18:57 -04:00
1 parent ad3443f60d
commit 33f60d3dcb
10 files changed
+201 -33

No files matched your search

+4 -2
View File
@@ -235,8 +235,10 @@ With prices, gross sheet cost is the supplied value. Salvage is still computed f
the largest qualifying material-edge offcut; net cost is
`Cost * (NetSheetArea / SheetArea)`. Set desktop salvage rate to zero for purchase-price
comparisons. Entering prices preserves the selected salvage settings. MCP and API
currently disable salvage. Without prices, scores retain their existing area units
and tie ordering; fixed strategies retain their legacy no-salvage area tie-break.
currently disable salvage. Without prices, scores retain their existing area units;
whole-job engines break exact cost ties by the compactness offcut (see
[cost basis](nesting-engines.md#cost-basis-and-heuristic-limits)), and fixed strategies retain
their legacy no-salvage area tie-break.
Desktop reports gross cost, estimated salvage credit and net score. MCP reports
`basis`, each stock's used physical count, supplied cost and gross subtotal, plus