New engines start from the shared test kit (the template's tests are a one-line EngineContractTests subclass) and the host APIs, so they don't re-derive geometry reading, work areas or validator tolerances. BENCH-RULES.md now forbids clocks, unseeded randomness and environment variables from influencing placement (budgets count work; wall time only through the host's cancellation token) and lists the kit as read-only. Build-Engines.ps1 deploys only OpenNest.Engine.* folders, and New-Engine.ps1 -IncludeBuildFiles copies the kit. Co-Authored-By: Codex <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
2.0 KiB
C#
44 lines
2.0 KiB
C#
using System;
|
|
using System.Threading;
|
|
using OpenNest.Engine.Jobs;
|
|
|
|
namespace OpenNest.Engine.__NAME__;
|
|
|
|
/// <summary>
|
|
/// TODO: name and describe the actual placement strategy here (e.g. "skyline packer with
|
|
/// greedy shelf assignment", "NFP-based sliding placement with simulated-annealing order
|
|
/// search", etc). This must be an independently designed algorithm — see README.md.
|
|
/// </summary>
|
|
public sealed class __NAME__NestingEngine : INestingEngine
|
|
{
|
|
public NestJobResult Solve(
|
|
NestJob job,
|
|
IProgress<NestJobProgress>? progress = null,
|
|
CancellationToken token = default
|
|
)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(job);
|
|
token.ThrowIfCancellationRequested();
|
|
|
|
// TODO: implement independent placement logic here.
|
|
//
|
|
// Do NOT call NestingEngineRegistry.Create(...), PlateNesterFactory, PlateFillService,
|
|
// or any built-in INestingEngine, and do not run several and keep the best. The
|
|
// Fill/ and pattern components (FillLinear, PairFiller, PatternTiler, Compactor, ...)
|
|
// and OpenNest.Core geometry ARE fair game as tools; the decisions are yours.
|
|
//
|
|
// job.Parts -> requested parts (PartGeometrySnapshot geometry, quantity, priority, rotation policy)
|
|
// job.Plates -> candidate stock sheets (size, spacing, edge spacing, quadrant, quantity)
|
|
// job.Options -> job-wide options
|
|
//
|
|
// Read material with JobPartGeometry.TryRead(part.Geometry); use stock.WorkArea/Fits,
|
|
// RotationCandidates.ForShape and NestJobCost as primitives for your own decisions.
|
|
// var result = new NestJobResultBuilder(job, progress);
|
|
// result.AddSheet(stock, poses); // (PartId, X, Y, Rotation); call only on commit.
|
|
// return result.Build(NestJobStopReason.NoPlacementFound);
|
|
// The builder assigns sheet/instance indices, fulfillment, usage and commit progress.
|
|
|
|
throw new NotImplementedException("__NAME__ nesting engine placement logic not yet implemented.");
|
|
}
|
|
}
|