SchedulingConfig#
Project-wide scheduling settings. It's the Config property of ProjectData, which starts as new SchedulingConfig(). Create one with an object initializer and set only the properties that differ from the defaults.
Declaration#
public sealed class SchedulingConfig : IDeepCloneable<SchedulingConfig>
The config is read when project data is solved or analyzed. A Project keeps its own copy, so changing this object afterwards has no effect until the next Solve(data, …).
Constructors#
SchedulingConfig()#
public SchedulingConfig()
Creates a config with every property at its default.
Properties#
ApplyConstraints#
public bool ApplyConstraints { get; set; } = false;
true turns task constraints (TaskData.ConstraintType) into hard bounds, and violations are reported as conflicts in the result. false ignores every constraint, Mso and Mfo included.
ScheduleFromEnd#
public bool ScheduleFromEnd { get; set; } = false;
true plans the project backward (ALAP), from ProjectEnd and the tasks' end dates. Project.Level doesn't support backward projects.
GapBehavior#
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#
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#
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#
public bool GroupMode { get; set; } = false;
true suppresses the constraint inheritance of ProjectConstraint. It has no other effect.
UseProgress#
public bool UseProgress { get; set; } = false;
true treats a task with Progress == 1 as completed: it keeps its dates and never moves.
DescendantLinks#
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.
CalendarMode#
public CalendarMode CalendarMode { get; set; } = CalendarMode.Resource;
Which calendars place the work: resource calendars intersected with task calendars, or task calendars only. See CalendarMode.
StrictCalendar#
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.
MaxIterations#
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 is false.
ProjectStart#
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. In Validation.Repair mode it's also the start date given to tasks without dates.
ProjectEnd#
public Moment? ProjectEnd { get; set; }
End bound of a backward project, used when ScheduleFromEnd is true. null (default) sets no bound.
DurationUnit#
public TimeUnit DurationUnit { get; set; } = TimeUnit.Day;
Default unit of TaskData.Duration and LinkData.Lag, used when a task or link sets no unit of its own. See TimeUnit.
UseCalendars#
public bool UseCalendars { get; set; } = true;
false makes every calendar flat 24/7 time, so all time is working time.
DefaultResourceCapacity#
public double DefaultResourceCapacity { get; set; } = 1.0;
Capacity of a resource whose ResourceData.Capacity 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#
public Id RootId { get; set; } = Id.Num(0.0);
The TaskData.Parent 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#
public SchedulingConfig DeepClone()
Returns a copy that shares no state with this instance.
Returns - a new SchedulingConfig with the same values.
ToString#
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.
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.
Example#
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- holds the configCalendarMode- the calendar selection setting- Project data - the config switches in context
- Links, constraints and summaries - constraints, gaps and summaries
- Working time and calendars - calendar settings