LevelingResult#
The result of Project#level. It holds the leveled schedule and the number of leveling rounds that proposed a correction.
Declaration#
;
Fields#
Each field has a fluent setter of the same name, withX(value), that returns this result.
| Field | Type | Default | Description |
|---|---|---|---|
schedule |
ScheduleResult |
null |
The schedule after leveling. Always set in a result from level. |
rounds |
int |
0 |
The number of rounds that proposed a correction. |
schedule#
The schedule of the final replan, with these values in its fields:
updatesinclude thelevelingDelayandpauseschanges as ordinaryMutationentries. The diff is against the state thelevelcall started from, so the entries apply to the model the caller already holds.- Each
OverallocationWindowleft inoverallocationshas areason. conflicts,notesandconvergedcome from the final replan.
The project keeps this ScheduleResult as its baseline and shares it with copies. It's read-only by contract. Call schedule.deepClone() before changing it.
rounds#
Counts only the rounds that proposed a delay or a pause. A contended bucket that leveling can't resolve doesn't add a round. On a cyclic project, rounds is 0 and schedule is the initial solve's result. There is no cap on rounds. See Leveling resources.
Methods#
deepClone#
public LevelingResult
Returns a new LevelingResult with the same rounds and the same schedule reference. The ScheduleResult isn't cloned. Call schedule.deepClone() for an independent copy of the schedule.
Returns - a new LevelingResult that shares schedule with this one.
copy#
public LevelingResult
Returns a shallow copy. The copy shares schedule with this result.
Returns - a new LevelingResult with the same field values.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. equals and hashCode compare schedule and rounds by value. toString() lists both fields, e.g. LevelingResult{schedule=ScheduleResult{…}, rounds=1}.
Example#
Two tasks share one resource. Leveling delays one of them and reports the change in schedule.updates.
;
;
Related#
Project#level- the call that returns the resultLevelingOptions- options oflevelScheduleResult- the leveled schedule- Leveling Resources - reading the result
- Clear leveling - removing leveling delays and pauses