LeveledMetrics#
Metrics of a leveled stage, plus a summary of the leveling run. It's found in CandidateResult.leveled and SuggestProposal.leveled, and only when the call's options set level. It's null when the scheduled stage is cyclic, because then there's no leveled stage.
Declaration#
;
Constructors#
LeveledMetrics()#
public
Creates an instance with metrics = null, converged = false, rounds = 0 and windows = 0. Project#evaluate and Project#suggestAssignments build these values; creating one by hand is mainly useful in tests.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
metrics |
Metrics |
null |
Finish, overload, conflicts, cycles and cost of the leveled stage, against the baseline. |
converged |
boolean |
false |
converged of the leveled schedule. |
rounds |
int |
0 |
Leveling rounds run. |
windows |
int |
0 |
Overallocation windows left after leveling, for every reason. |
metrics#
public Metrics metrics
The leveled stage, measured against the same baseline as the scheduled stage. metrics.cost is the stage's cost. A candidate's CandidateResult.cost equals it whenever leveled is set.
converged#
public boolean converged
ScheduleResult.converged of the schedule the leveling run returned.
rounds#
public int rounds
LevelingResult.rounds of the leveling run.
windows#
public int windows
The number of overallocation windows still left in the leveled schedule, summed over all resources, whatever the reason each one remained. 0 means leveling resolved every overallocation. The windows themselves aren't in the result. For what a window is, see ResourceOverallocation.
Methods#
withMetrics, withConverged, withRounds, withWindows#
public LeveledMetrics
public LeveledMetrics
public LeveledMetrics
public LeveledMetrics
Each setter assigns its field and returns this instance.
Returns: this LeveledMetrics.
deepClone#
public LeveledMetrics
Returns a copy with a deep copy of metrics. No nested object is shared with the original.
Returns: a new LeveledMetrics.
Errors: NullPointerException when metrics is null.
copy#
public LeveledMetrics
Returns a shallow copy: the new instance holds the same metrics object.
Returns: a new LeveledMetrics.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. Two instances are equal when metrics is equal and converged, rounds and windows match. toString() prints every field, for logging.
Example#
Score one candidate with leveling and read its leveled stage.
;
;
Related#
Metrics- the type ofmetricsCandidateResult- holds the leveled stage of a candidateLevelingOptions- the options that turn the leveled stage onLevelingResult- the result of a committed leveling run- Evaluating alternatives - reading metrics and cost