EvaluateOptions#
Options for Project#evaluate and Project#evaluateWith. They set the baseline the call expects, whether each candidate also gets a leveled stage, which tasks get per-task finish and overload figures, and whether candidates are scored against a cleared copy of the baseline. new EvaluateOptions() scores the scheduled stage only, with no focus tasks.
Declaration#
Set fields with the fluent withX setters: new EvaluateOptions().withLevel(new LevelingOptions()).
Constructors#
EvaluateOptions()#
public
Creates options with every field at its default.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
baselineId |
String |
null |
The baseline the call expects. null skips the check. |
level |
LevelingOptions |
null |
Adds a leveled stage to each candidate. null scores the scheduled stage only. |
focus |
Vec<Id> |
empty | Tasks to report finish and overload for. Must not be null. |
clearFirst |
boolean |
false |
Scores against a copy of the baseline with leveling delays and pauses cleared. |
baselineId#
public String baselineId ;
A baseline token taken from the latest ScheduleResult.baselineId. When it isn't null and doesn't name the project's current baseline, Project#evaluate throws a ProjectException with code STALE_BASELINE.
Each candidate's SchedulingChanges.baselineId is checked the same way, independently of this field.
level#
public LevelingOptions level ;
When set, every candidate is leveled with these options after it's solved, and CandidateResult.leveled holds the LeveledMetrics of that stage. The options are used unchanged, so level.clearFirst (default true) applies. When null, CandidateResult.leveled is always null.
level.basis, when given, is the bucket basis for every overload figure in the result, baseline included. Without it, the basis is derived from the project.
Options that are invalid for the baseline make Project#evaluate throw an InputException. To commit a scored candidate with Project#level, pass the same LevelingOptions, step included, so the committed plan matches the scored one.
focus#
public Vec focus ;
Task ids that get per-task figures in every Metrics value of the result: one TaskFinish entry in finish.tasks and one FocusOverload entry in overload.focus per id, in this order. An empty list adds no per-task figures.
Every id must name a task in the baseline. An unknown id makes Project#evaluate throw an InputException with path focus[i]. A focus task that a candidate removes reports null for its finish and focus overload in that candidate's metrics.
clearFirst#
public boolean clearFirst ;
When true, the reference state is a copy of the baseline with levelingDelay and pauses cleared on the tasks in scope, then solved. The scope is level.scope.tasks when level gives it, otherwise every task, also when level is null. EvaluateResult.baseline and every candidate are measured on that copy.
clearFirstis independent oflevel.clearFirst, so it also applies when only the scheduled stage is scored.baselineId, candidate tokens,levelandfocusare checked against the accepted baseline before anything is cleared. A valid candidatebaselineIdis dropped before that candidate's changes are applied to the copy.EvaluateResult.baselineIdstays the accepted baseline's id.- When nothing in scope has a delay or pause to clear, the result is identical to
clearFirst = false.
Methods#
withBaselineId, withLevel, withFocus, withClearFirst#
public EvaluateOptions
public EvaluateOptions
public EvaluateOptions
public EvaluateOptions
public EvaluateOptions
Each setter assigns its field and returns this instance for chaining. The Collection overload of withFocus copies the ids into a new Vec, so List.of(...) works. Passing null to either withFocus overload sets focus to null, which Project#evaluate rejects with a NullPointerException.
Returns - this EvaluateOptions.
deepClone#
public EvaluateOptions
Returns a copy that shares no nested object (level, the focus list) with this instance.
Returns - a new EvaluateOptions with the same values.
copy#
public EvaluateOptions
Returns a shallow copy. The copy shares the level object and the focus list with this instance.
Returns - a new EvaluateOptions with the same field values.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. Two EvaluateOptions are equal when their public fields are equal, nested records compared by value. toString() lists the fields.
Example#
;
;
Related#
Project#evaluate- the call these options configureLevelingOptions- the options of the leveled stageEvaluateResult- the result the options shapeProjectException- thrown withSTALE_BASELINEfor an outdatedbaselineId- Evaluating alternatives - choosing focus tasks and a leveled stage