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


# SchedulingConfig

Project-wide scheduling settings. It's the `Config` property of [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/project-data.md>), which starts as `new SchedulingConfig()`. Create one with an object initializer and set only the properties that differ from the defaults.

## Declaration

```csharp
public sealed class SchedulingConfig : IDeepCloneable<SchedulingConfig>
```

The config is read when project data is solved or analyzed. A [`Project`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md>) keeps its own copy, so changing this object afterwards has no effect until the next `Solve(data, …)`.

## Constructors

### SchedulingConfig()

```csharp
public SchedulingConfig()
```

Creates a config with every property at its default.

## Properties

### ApplyConstraints

```csharp
public bool ApplyConstraints { get; set; } = false;
```

`true` turns task constraints ([`TaskData.ConstraintType`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/task-data.md#constrainttype>)) into hard bounds, and violations are reported as conflicts in the result. `false` ignores every constraint, `Mso` and `Mfo` included.

### ScheduleFromEnd

```csharp
public bool ScheduleFromEnd { get; set; } = false;
```

`true` plans the project backward (ALAP), from `ProjectEnd` and the tasks' end dates. [`Project.Level`](<https://docs.dhtmlx.com/planning-engine/net/api/project-level.md>) doesn't support backward projects.

### GapBehavior

```csharp
public GapBehavior GapBehavior { get; set; } = GapBehavior.Preserve;
```

What happens to the free time between a task and the bound its links put on it. The values are listed in the `GapBehavior` section below.

### MoveProjects

```csharp
public bool MoveProjects { get; set; } = true;
```

`true` moves a summary task with its children as one block. `false` expands links on a summary to its leaf tasks.

### ProjectConstraint

```csharp
public bool ProjectConstraint { get; set; } = false;
```

`true` makes a task without its own constraint inherit the constraint of its nearest ancestor. Takes effect only with `ApplyConstraints`, and `GroupMode` turns it off.

### GroupMode

```csharp
public bool GroupMode { get; set; } = false;
```

`true` suppresses the constraint inheritance of `ProjectConstraint`. It has no other effect.

### UseProgress

```csharp
public bool UseProgress { get; set; } = false;
```

`true` treats a task with `Progress == 1` as completed: it keeps its dates and never moves.

### DescendantLinks

```csharp
public bool DescendantLinks { get; set; } = false;
```

`true` allows a link between a summary task and one of its own descendants. With `false`, such a link is dropped and reported as a [`Note.DroppedLink`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/note.md>).

### CalendarMode

```csharp
public CalendarMode CalendarMode { get; set; } = CalendarMode.Resource;
```

Which calendars place the work: resource calendars intersected with task calendars, or task calendars only. See [`CalendarMode`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/calendar-mode.md>).

### StrictCalendar

```csharp
public bool StrictCalendar { get; set; } = false;
```

`true` reports a `Conflict.CalendarNonWorking` when a task that moves with its summary block lands on non-working time. See [`Conflict`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/conflict.md>).

### MaxIterations

```csharp
public uint MaxIterations { get; set; } = 8;
```

Upper limit on planner passes. Must be at least `1`; `0` fails validation at `config.max_iterations`. When the limit is reached, the result's [`Converged`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md#converged>) is `false`.

### ProjectStart

```csharp
public Moment? ProjectStart { get; set; }
```

Start bound of a forward project. `null` (default) sets no bound. How the bound applies to tasks with and without predecessors is in [Scheduling a project](<https://docs.dhtmlx.com/planning-engine/net/scheduling/scheduling-a-project.md>). In [`Validation.Repair`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/validation.md>) mode it's also the start date given to tasks without dates.

### ProjectEnd

```csharp
public Moment? ProjectEnd { get; set; }
```

End bound of a backward project, used when `ScheduleFromEnd` is `true`. `null` (default) sets no bound.

### DurationUnit

```csharp
public TimeUnit DurationUnit { get; set; } = TimeUnit.Day;
```

Default unit of [`TaskData.Duration`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/task-data.md#properties>) and [`LinkData.Lag`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/link-data.md#lag>), used when a task or link sets no unit of its own. See [`TimeUnit`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/time-unit.md>).

### UseCalendars

```csharp
public bool UseCalendars { get; set; } = true;
```

`false` makes every calendar flat 24/7 time, so all time is working time.

### DefaultResourceCapacity

```csharp
public double DefaultResourceCapacity { get; set; } = 1.0;
```

Capacity of a resource whose [`ResourceData.Capacity`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/resource-data.md#properties>) is `null`, in assignment `Value` units (`1.0` = 100 %). Must be finite and non-negative; anything else fails validation at `config.default_resource_capacity`.

### RootId

```csharp
public Id RootId { get; set; } = Id.Num(0.0);
```

The [`TaskData.Parent`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/task-data.md#properties>) value that means "no parent", for data whose virtual root isn't `0`. Ids compare as normalized keys, so the default matches both `0` and `"0"`. A parent equal to `RootId` is removed on import, so stored tasks never point at the root. With another `RootId`, a task with id `0` is an ordinary parent. An empty string `""` always means "no parent" as well.

## Methods

### DeepClone

```csharp
public SchedulingConfig DeepClone()
```

Returns a copy that shares no state with this instance.

**Returns** - a new `SchedulingConfig` with the same values.

### ToString

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

Returns a debug dump of all properties, e.g. `SchedulingConfig { ApplyConstraints: false, ScheduleFromEnd: false, ... }`.

## GapBehavior

What happens to the gap between a task and the earliest position its links allow. Set through `SchedulingConfig.GapBehavior`.

```csharp
public enum GapBehavior
{
    Preserve,
    Compress,
}
```

| Value | Description |
|---|---|
| `Preserve` | Default. A task keeps its own dates when its links allow them. A link moves it only when the task would otherwise start too early. |
| `Compress` | Every task is pulled to the earliest position its links and constraints allow, closing the gaps. |

How each mode interacts with links and project bounds is in [Links, constraints and summaries](<https://docs.dhtmlx.com/planning-engine/net/scheduling/links-constraints-summaries.md>).

## Example

```csharp
using Plen;

var kickoff = Moment.FromYmdHm(2026, 3, 2, 8, 0) ?? throw new InvalidOperationException("invalid date");

var data = new ProjectData
{
    Config = new SchedulingConfig
    {
        ApplyConstraints = true,
        GapBehavior = GapBehavior.Compress,
        DurationUnit = TimeUnit.Hour,
        ProjectStart = kickoff,
    },
    Tasks =
    [
        new TaskData(1) { StartDate = kickoff, Duration = 16 },
        new TaskData(2) { StartDate = kickoff, Duration = 8 },
    ],
    Links =
    [
        new LinkData { Id = 1, Source = 1, Target = 2 },
    ],
};

var result = Engine.Schedule(data, new SolveOptions());
```

## Related

- [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/project-data.md>) - holds the config
- [`CalendarMode`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/calendar-mode.md>) - the calendar selection setting
- [Project data](<https://docs.dhtmlx.com/planning-engine/net/scheduling/project-data.md>) - the config switches in context
- [Links, constraints and summaries](<https://docs.dhtmlx.com/planning-engine/net/scheduling/links-constraints-summaries.md>) - constraints, gaps and summaries
- [Working time and calendars](<https://docs.dhtmlx.com/planning-engine/net/scheduling/working-time-calendars.md>) - calendar settings
