mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-29 17:02:49 -05:00
feat(engine): report best whole-job plans from Rectangles, Circles and Default
Desktop Auto Nest's "Best plan so far" strip now fills in for every built-in whole-job engine except FlatBar, not only Irregular. - Rectangles makes one sheet-by-sheet run, so it reports the finished job as its one plan, then replays its plate commits (token checked as before). - Circles reports when a stock-preference run or a tail re-plan beats its best result so far. - Default scores each candidate plan as it ranks results (valid, fewest unplaced, lowest cost, candidate order) and reports it only when it beats every plan already shown, so a later candidate never shows a worse plan. The chosen result is always the last plan reported. - Shared ReportPlan/SameLayout helpers on CandidateProgress; Irregular uses them too. Reporting never changes the search. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cd2bea054b
commit
00acaeaaf1
11 files changed
+275
-13
No files matched your search
@@ -182,6 +182,18 @@ public class RectanglesNestingEngineTests
|
||||
Assert.Empty(result.Plates);
|
||||
Assert.Equal(1, Assert.Single(result.Fulfillment).Unplaced);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReportsTheFinishedJobAsItsPlanBeforeCommitting()
|
||||
{
|
||||
var job = Job(new[] { Part("rect", Rectangle(10, 5), 30), Part("ell", LShape(12, 8, 4), 6) },
|
||||
new[] { Stock("small", 30, 30, spacing: 0.25), Stock("large", 48, 60, spacing: 0.25) });
|
||||
|
||||
var plans = PlanAssert.ReportedAndEndWithTheResult(() => new RectanglesNestingEngine(), job);
|
||||
|
||||
// One sheet-by-sheet run makes one whole-job plan.
|
||||
Assert.Single(plans);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class RectanglesContractTests : EngineContractTests<RectanglesNestingEngine> { }
|
||||
Reference in new issue
Block a user