API reference#

The .NET API of Planning Engine ships as two NuGet packages. Plen.Core schedules, edits, levels and scores projects. Plen.Assign is an optional skill layer that turns workers and skill requirements into slots for auto-assignment. Both target net10.0.

How the API is organized#

The first level of this reference is the package:

  • core - Plen.Core, namespace Plen. Every core type lives in this one namespace. The folders under core group the types by topic and aren't namespaces.
  • assign - Plen.Assign, namespace Plen.Assign. It depends on Plen.Core. Its SkillLayer.Slots method returns the slot list that Project.SuggestAssignments takes.

Each call has its own page at the top of api/: the methods of Project and the static methods Engine.Schedule and SkillLayer.Slots.

dotnet add package Plen.Core
dotnet add package Plen.Assign

Add Plen.Assign only for skill-based auto-assignment. JSON input and output are in a separate package, Plen.Wire; see Exchange JSON with a client.

using Plen;
using Plen.Assign;

Every call in both packages is synchronous: there are no Async methods and no CancellationToken parameters. Nothing is IDisposable. A Project isn't thread-safe; see Share a project between threads.

Failures are exceptions. Invalid input throws InputException, and a call that doesn't fit the project's state throws ProjectException. Both derive from PlenException. A null argument that isn't declared nullable throws ArgumentNullException. Cycles, conflicts and rejected edits come back as data in the result. See Error handling for which failures throw and which don't.

Calls by task#

To Call Options Returns
Load a live project or reschedule its edits Project.Solve SolveOptions ScheduleResult
See what an edit would do Project.Preview PreviewOptions ScheduleResult
Get critical path and slack without scheduling Project.Analyze AnalyzeOptions ScheduleResult
Commit an edit Project.Apply SchedulingChanges ApplyReport
Resolve resource overallocation Project.Level LevelingOptions LevelingResult
Read resource load per day or hour Project.LoadProfile LoadProfileOptions LoadProfile
Compare alternative edits Project.Evaluate EvaluateOptions EvaluateResult
Compare alternative edits on several threads Project.EvaluateWith EvaluateOptions, Execution EvaluateResult
Pick resources for open positions Project.SuggestAssignments SuggestOptions SuggestResult
Read tasks, resources and assignments for building slots Project.Roster - Roster
Schedule a snapshot once Engine.Schedule SolveOptions ScheduleResult
Build slots from skills and requirements SkillLayer.Slots Pool, Requirement List<Slot>

Preview, LoadProfile, Evaluate, EvaluateWith, SuggestAssignments, Roster and SkillLayer.Slots need a solved project. The constructor, Clone() and ToString() are on the Project page.