SolveOptions#
Options for Project#solve and Engine.schedule. They set which part of the project is scheduled and which extra data the ScheduleResult carries. new SolveOptions() schedules the whole project and reports only the changed tasks.
Declaration#
Set fields with the fluent withX setters: new SolveOptions().withReasons(true). Two instances are equal when all four fields are equal, compared by value. For how Project#solve uses that equality to return its cached result, see Project#solve.
Constructors#
SolveOptions()#
public
Creates options with every field at its default.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
subtree |
Subtree |
null |
Schedules only one task's subtree and the tasks that depend on it. null schedules the whole project. |
analytics |
AnalyticsOptions |
new AnalyticsOptions() (no analytics) |
Requests critical path and slack. Fills ScheduleResult.analytics. |
reasons |
boolean |
false |
Fills Mutation.reason on each update with the Reason the task moved. |
includeUnchanged |
boolean |
false |
Also reports unchanged tasks in ScheduleResult.updates, so the result holds the full date list. |
subtree#
public Subtree subtree ;
Limits scheduling to the scope the Subtree value describes. Build the value with new Subtree(id).
analytics#
public AnalyticsOptions analytics ;
Turns on AnalyticsOptions.slack and AnalyticsOptions.criticalPath. With both flags false (the default), ScheduleResult.analytics is null. With either flag set, it holds an Analytics value. Check its status before reading the data.
reasons#
public boolean reasons ;
When true, each Mutation in updates carries a Reason in its reason field. When false, reason is always null.
Mutation.reason lists the cases where it stays null even with reasons = true.
includeUnchanged#
public boolean includeUnchanged ;
When false, updates holds only the tasks the solve changed or that edits touched. When true, updates also holds every scheduled task that didn't change, each with startDate, endDate and duration set. The result is the full normalized date list for an initial load.
- Every scheduled task is reported: leaves, summaries and milestones. Unscheduled tasks are never reported.
- With
subtree, every task in the subtree is reported, ancestors of subtree tasks included, plus the usual changed or touched updates outside the subtree. - On a project with cycles, every scheduled task is reported in model order (
subtreeis ignored), with its stored dates and durations. levelingDelayandpausesare never set in these entries.
The extra entries don't affect ScheduleResult.baselineId, which follows real date changes only. Every other result field matches what the same solve returns with includeUnchanged = false.
Methods#
withSubtree, withAnalytics, withReasons, withIncludeUnchanged#
public SolveOptions
public SolveOptions
public SolveOptions
public SolveOptions
Each setter assigns its field and returns this instance for chaining.
Returns - this SolveOptions.
deepClone#
public SolveOptions
Returns a copy that shares no nested object (subtree, analytics) with this instance.
Returns - a new SolveOptions with the same values.
copy#
public SolveOptions
Returns a shallow copy. The copy shares the subtree and analytics objects with this instance.
Returns - a new SolveOptions with the same field values.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. Two SolveOptions are equal when their public fields are equal, nested records compared by value. toString() lists the fields.
Example#
;
;
Related#
Project#solve- the stateful call that takes itEngine.schedule- the one-shot call that takes itSubtree- limits scheduling to one branchAnalyticsOptions- slack and critical path switches- Solve options - choosing the switches