[Canonical page](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# Project

A stateful project. It holds one accepted baseline (the last solved dates), takes incremental edits and answers read-only questions about them: previews, analytics, load, candidate scoring and assignment proposals. Create it with [`new Project()`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md#constructors>), then load data with [`Solve`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md#solve>).

For a one-shot run over a snapshot, use [`Engine.Schedule`](<https://docs.dhtmlx.com/planning-engine/net/api/engine-schedule.md>) instead.

## Declaration

```csharp
namespace Plen;

public sealed class Project
```

`Project` has no public properties. It isn't `IDisposable` and needs no explicit release; the garbage collector reclaims it.

[`Solve`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md#solve>), [`Apply`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md#apply>) and [`Level`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md#level>) change the project. Every other method leaves it unchanged. All methods are synchronous and CPU-only, and each one throws `ArgumentNullException` for a `null` argument that isn't declared nullable.

A `Project` isn't thread-safe, and that includes the read-only methods. To work from several threads, create one [`Clone()`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md#clone>) per thread on a single thread first, or score candidates with [`EvaluateWith`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md#evaluatewith>) and [`Execution.Parallel()`](<https://docs.dhtmlx.com/planning-engine/net/api/core/evaluate/execution.md#parallel>).

## Constructors

### Project

```csharp
public Project(ProjectOptions? options = null)
```

Creates an empty, unsolved project. The constructor copies `options`, so later changes to the caller's object don't reach the project.

**Parameters**

| Name | Type | Description |
|---|---|---|
| `options` | [`ProjectOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project-options.md>)`?` | Project-wide settings, such as the validation mode. Optional; `null` uses the defaults (strict validation). |

**Returns** an empty `Project` with no baseline.

## Methods

Each method below except `Clone` and `ToString` has its own page with the full contract.

### Solve

```csharp
public ScheduleResult Solve(ProjectData? data, SolveOptions options)
```

Schedules the project and accepts the scheduled dates as the baseline. A [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/project-data.md>) replaces the project's data; `null` reschedules the current state after `Apply`, or returns the cached result when nothing changed since a solve with equal options.

**Returns** a [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) that the project keeps as its baseline.

**Errors**: [`InputException`](<https://docs.dhtmlx.com/planning-engine/net/api/core/errors/input-exception.md>) for invalid data, [`ProjectException`](<https://docs.dhtmlx.com/planning-engine/net/api/core/errors/project-exception.md>) `NeedsResync` for `null` after a rejected `Apply`. See [`Project.Solve`](<https://docs.dhtmlx.com/planning-engine/net/api/project-solve.md>).

### Preview

```csharp
public ScheduleResult Preview(SchedulingChanges changes, PreviewOptions options)
```

Schedules hypothetical changes on a copy of the solved baseline. The project isn't modified.

**Returns** a [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) for the previewed state.

**Errors**: `ProjectException` `NoBaseline` / `StaleBaseline`, `InputException` for a rejected operation. See [`Project.Preview`](<https://docs.dhtmlx.com/planning-engine/net/api/project-preview.md>).

### Analyze

```csharp
public ScheduleResult Analyze(ProjectData? data, AnalyzeOptions options)
```

Computes analytics, cycles and overallocations over supplied dates, or over the current dates when `data` is `null`. It doesn't schedule and never installs data.

**Returns** a [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) with no updates.

**Errors**: `InputException` for invalid supplied data. See [`Project.Analyze`](<https://docs.dhtmlx.com/planning-engine/net/api/project-analyze.md>).

### Apply

```csharp
public ApplyReport Apply(SchedulingChanges changes)
```

Commits edits to the accepted state and marks it unsolved. Rejected operations go into the report, not into an exception, and leave the project needing a full `Solve(data, …)`.

**Returns** an [`ApplyReport`](<https://docs.dhtmlx.com/planning-engine/net/api/core/changes/apply-report.md>).

**Errors**: `ProjectException` `NeedsResync` / `StaleBaseline`. See [`Project.Apply`](<https://docs.dhtmlx.com/planning-engine/net/api/project-apply.md>).

### Level

```csharp
public LevelingResult Level(LevelingOptions options)
```

Solves the current state, resolves resource overallocation with persistent `LevelingDelay` / `Pauses` edits and accepts the leveled state as the baseline. To see leveling without committing it, call `Level` on a [`Clone()`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md#clone>).

**Returns** a [`LevelingResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/leveling-result.md>).

**Errors**: `InputException` for invalid options, `ProjectException` `NeedsResync`. See [`Project.Level`](<https://docs.dhtmlx.com/planning-engine/net/api/project-level.md>).

### LoadProfile

```csharp
public LoadProfile LoadProfile(LoadProfileOptions options)
```

Reads per-bucket load and capacity of resources on the solved baseline. A [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/profile-query.md>) converts implicitly to [`LoadProfileOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/load-profile-options.md>).

**Returns** a [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/load-profile.md>).

**Errors**: `ProjectException` `NoBaseline` / `StaleBaseline`, `InputException` for an invalid range or resource. See [`Project.LoadProfile`](<https://docs.dhtmlx.com/planning-engine/net/api/project-load-profile.md>).

### Evaluate

```csharp
public EvaluateResult Evaluate(IReadOnlyList<Candidate> candidates, EvaluateOptions options)
```

Scores alternative change sets against the solved baseline, each on a disposable copy. The project is never modified. A failure inside one candidate goes into that candidate's result.

**Returns** an [`EvaluateResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/evaluate/evaluate-result.md>).

**Errors**: `ProjectException` `NoBaseline` / `StaleBaseline`, `InputException` for invalid options. See [`Project.Evaluate`](<https://docs.dhtmlx.com/planning-engine/net/api/project-evaluate.md>).

### EvaluateWith

```csharp
public EvaluateResult EvaluateWith(
    IReadOnlyList<Candidate> candidates,
    EvaluateOptions options,
    Execution execution)
```

`Evaluate` with a choice of [`Execution`](<https://docs.dhtmlx.com/planning-engine/net/api/core/evaluate/execution.md>). `Execution.Parallel(...)` scores candidates on worker threads and blocks until all finish. Results are identical to `Evaluate` and keep input order.

**Returns** an [`EvaluateResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/evaluate/evaluate-result.md>).

**Errors**: same as `Evaluate`. See [`Project.Evaluate`](<https://docs.dhtmlx.com/planning-engine/net/api/project-evaluate.md>).

### SuggestAssignments

```csharp
public SuggestResult SuggestAssignments(IReadOnlyList<Slot> slots, SuggestOptions options)
```

Proposes resources for requirement slots and returns the proposal as a change set. The project is never modified; commit the proposal with `Apply(result.Changes)`.

**Returns** a [`SuggestResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/suggest/suggest-result.md>).

**Errors**: `ProjectException` `NoBaseline` / `StaleBaseline`, `InputException` for invalid options or slots. See [`Project.SuggestAssignments`](<https://docs.dhtmlx.com/planning-engine/net/api/project-suggest-assignments.md>).

### Roster

```csharp
public Roster Roster()
```

Reads the accepted state without skills: scheduled leaf tasks, resources and active assignments, in model order.

**Returns** a [`Roster`](<https://docs.dhtmlx.com/planning-engine/net/api/core/suggest/roster.md>).

**Errors**: `ProjectException` `NoBaseline` when the project is unsolved or has unsolved edits. See [`Project.Roster`](<https://docs.dhtmlx.com/planning-engine/net/api/project-roster.md>).

### Clone

```csharp
public Project Clone()
```

Returns an independent copy. Both projects share their state, including the cached solve result, until one of them changes it, so cloning is cheap. Edits to one copy never affect the other.

Shared results are the same objects in both projects. Treat them as read-only, or call `DeepClone()` on one before modifying it.

**Returns** a new `Project` with the same state, baseline and validation mode.

### ToString

```csharp
public override string ToString()
```

Returns a debug dump of the whole project state. Two dumps are equal exactly when the states are equal.

**Returns** a `string`.

## Example

Load a project, commit an edit and reschedule it, falling back to a full reload when the edit is rejected.

```csharp
using Plen;

var monday = Moment.FromYmdHm(2026, 8, 10, 8, 0) ?? throw new InvalidOperationException("invalid date");
var data = new ProjectData
{
    Tasks = [new TaskData(1) { StartDate = monday, Duration = 2.0 }],
};

var options = new SolveOptions();
var project = new Project();
project.Solve(data, options);

var changes = new SchedulingChanges();
changes.Tasks.Update.Add(new TaskUpdate(1) { Duration = 3.0 });

var report = project.Apply(changes);
var result = report.NeedsResync
    ? project.Solve(data, options)
    : project.Solve(null, options);

foreach (var update in result.Updates)
    Console.WriteLine($"task {update.Id}: {update.StartDate} .. {update.EndDate}");
```

## Related

- [`ProjectOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project-options.md>) - the constructor options, such as the validation mode
- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) - the result of `Solve`, `Preview` and `Analyze`
- [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/net/api/core/changes/scheduling-changes.md>) - the edits `Apply` and `Preview` take
- [Scheduling a project](<https://docs.dhtmlx.com/planning-engine/net/scheduling/scheduling-a-project.md>) - when to keep a `Project` and how solving works
- [Editing a project](<https://docs.dhtmlx.com/planning-engine/net/live-projects/editing-a-project.md>) - committing edits and rescheduling
