LevelingScope#
Limits a Project::level run to part of the plan: the resources whose overallocation gets resolved, the tasks the leveler may move, and the date range in which contention is acted on. Set it as LevelingOptions::scope. LevelingScope::default() sets every field to None, which is the same as leveling the whole project.
Declaration#
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
resources |
Option<Vec<Id>> |
None (all resources) |
Resources whose overallocation the run resolves. Overallocation on any other resource is left as it is. Each id must name an existing resource. |
tasks |
Option<Vec<Id>> |
None (all tasks) |
Tasks the leveler may delay or split. Tasks not in the list keep their dates. Each id must name an existing task. |
from |
Option<DateTime> |
None (no lower bound) |
Start of the range, inclusive. A bucket is in scope when its start lies in [from, to). |
to |
Option<DateTime> |
None (no upper bound) |
End of the range, exclusive. |
The date range selects which overallocated buckets trigger a correction. It doesn't limit where tasks land or which tasks may move:
- a delayed task can end up after
to - a task that starts before
fromcan still be delayed when it contends in a bucket inside the range - a window that straddles
fromortois resolved only for its buckets inside the range
For how overallocation outside the scope is reported, see OverallocationWindow::reason.
See Project::level for the errors.
The scope also limits LevelingOptions::clear_first.
Example#
use ;
Related#
LevelingOptions- holds the scope as itsscopefieldProject::level- runs leveling within the scopeOverallocationWindow- reports windows outside the scope asout-of-scope- Leveling Resources - levels part of a plan with a scope