Subtree#
The scope of a scoped run. Set it as Subtree in SolveOptions or PreviewOptions to reschedule one task's branch instead of the whole project. Create it with new Subtree(task), and add an object initializer to set Inclusive yourself.
Declaration#
namespace Plen;
public sealed class Subtree : IDeepCloneable<Subtree>, IEquatable<Subtree>
Subtree has no parameterless constructor: Task is required.
Constructors#
Subtree(Id)#
public Subtree(Id task)
Creates a scope rooted at task with Inclusive = true.
Parameters
| Name | Type | Description |
|---|---|---|
task |
Id |
Root task ID. A string, double or int converts implicitly. |
Properties#
| Property | Type | Default | Description |
|---|---|---|---|
Task |
Id |
required | Root task of the scope. The scope covers this task, its ancestors and descendants, and every task reached from them through outgoing links, transitively. Each task reached this way brings its own ancestors and descendants. |
Inclusive |
bool |
true |
true also follows incoming links, so the scope takes in predecessors and their branches too. false follows outgoing links only. |
Methods#
DeepClone#
public Subtree DeepClone()
Returns a copy with the same Task and Inclusive.
Equals#
public bool Equals(Subtree? other)
Value equality: two scopes are equal when Task and Inclusive are equal. GetHashCode follows the same fields, so two SolveOptions with equal scopes compare equal.
ToString#
public override string ToString()
Returns a readable rendering of Task and Inclusive, for logging.
Errors#
A Task that's unknown or not scheduled makes the call that receives the options throw InputException with Kind = InputErrorKind.Validation and Path = "subtree.task".
Example#
using Plen;
// `project` already holds solved data with a task "2".
static ScheduleResult RescheduleBranch(Project project)
{
var options = new SolveOptions
{
Subtree = new Subtree("2") { Inclusive = false },
};
return project.Solve(null, options);
}
Related#
SolveOptions- setSubtreeto scope a solvePreviewOptions- setSubtreeto scope a preview- Reschedule a branch - rescheduling one task's branch step by step
- Load all task dates - full date lists with a scoped run