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


# LevelingResult

The outcome of a leveling run: the leveled schedule and how many rounds proposed a correction. [`Project.Level`](<https://docs.dhtmlx.com/planning-engine/net/api/project-level.md>) returns it.

## Declaration

```csharp
namespace Plen;

public sealed class LevelingResult : IDeepCloneable<LevelingResult>, IEquatable<LevelingResult>
{
    public required ScheduleResult Schedule { get; set; }
    public uint Rounds { get; set; }

    public LevelingResult DeepClone();
    public bool Equals(LevelingResult? other);
}
```

## Properties

| Property | Type | Description |
|---|---|---|
| `Schedule` | [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) | The schedule `Level` accepted as the new baseline. |
| `Rounds` | `uint` | Number of leveling rounds that proposed a correction. |

### Schedule

```csharp
public required ScheduleResult Schedule { get; set; }
```

The final solved state after leveling. Its `BaselineId` is the accepted baseline.

Its `Updates` are diffed against the state the `Level` call started from. Entries include the `LevelingDelay` and `Pauses` values leveling set. Windows left in `Overallocations` carry a [`Reason`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/resource-overallocation.md>).

The project keeps this object as its baseline and shares it with clones. Treat it as read-only, or call `DeepClone()` on it before changing it. For the meaning of every field, see [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>).

### Rounds

```csharp
public uint Rounds { get; set; }
```

Counts only rounds that proposed a delay or a pause. It's `0` when nothing needed leveling, and when the project is cyclic: then `Schedule` is the initial solve's result, with its cycle diagnostics, and no delay or pause is edited.

`Rounds` is separate from the planner's iteration count. Planner convergence is [`Schedule.Converged`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md#converged>).

## Methods

### DeepClone

```csharp
public LevelingResult DeepClone()
```

Returns a new `LevelingResult` with the same `Rounds`. `Schedule` isn't copied: the new instance points to the same `ScheduleResult`. To get an independent schedule, call `result.Schedule.DeepClone()`.

### Equals

```csharp
public bool Equals(LevelingResult? other)
```

Value equality: `Schedule` is compared with [`ScheduleResult.Equals`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md#equals>) (lists element by element) and `Rounds` with `==`. `GetHashCode` follows the same fields.

## Example

```csharp
using Plen;

// Monday, August 10, 2026: two tasks book the same developer full time.
var monday = Moment.FromYmdHm(2026, 8, 10, 8, 0) ?? throw new InvalidOperationException("invalid date");
TaskData Task(string id) => new(id) { StartDate = monday, Duration = 2.0 };
AssignmentData Assign(string task) => new() { Task = task, Resource = "dev", Value = 1.0 };

var data = new ProjectData
{
    Tasks = [Task("a"), Task("b")],
    Resources = [new ResourceData { Id = "dev" }],
    Assignments = [Assign("a"), Assign("b")],
};

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

var result = project.Level(new LevelingOptions());
Console.WriteLine($"rounds: {result.Rounds}");
foreach (var update in result.Schedule.Updates)
    Console.WriteLine($"{update.Id}: start {update.StartDate}, delay {update.LevelingDelay}");
```

## Related

- [`Project.Level`](<https://docs.dhtmlx.com/planning-engine/net/api/project-level.md>) - the call that returns it
- [`LevelingOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/resources/leveling-options.md>) - the options of the leveling run
- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) - the leveled schedule in `Schedule`
- [Leveling resources](<https://docs.dhtmlx.com/planning-engine/net/resources-and-assignment/leveling-resources.md#reading-the-result>) - how leveling picks tasks and reading its result
- [Clear leveling](<https://docs.dhtmlx.com/planning-engine/net/how-to/clear-leveling.md>) - removing the delays and pauses leveling set
