Metrics#
The measurements of one evaluated state: finish dates, resource overload, conflict and cycle counts, and a cost that combines them. Project::evaluate and Project::evaluate_with return it inside an EvaluateResult: as EvaluateResult::baseline, as CandidateResult::scheduled, and nested in LeveledMetrics::metrics for the leveled stage. It isn't built by hand.
Declaration#
With the serde feature (cargo add plen-core --features serde), Metrics also implements Serialize and Deserialize, with field names in camelCase.
Fields#
Every Amount holds a value for this stage and a delta against the baseline.
| Field | Type | Description |
|---|---|---|
finish |
Finish |
Project finish and the finish of each focus task. |
overload |
Overload |
Resource overload: total, per resource, and per focus task. |
conflicts |
Amount |
Number of entries in the stage's ScheduleResult::conflicts (see Conflict). |
cycles |
Amount |
Number of entries in the stage's ScheduleResult::cycles (see Cycle). |
cost |
f64 |
Score of the stage. Lower is better. Formula below. |
cost#
cost = max(0, finish.project.delta)
+ overload.total.value
+ 1000 × (conflicts.value + cycles.value)
- A finish earlier than the baseline adds nothing. When
finish.projectisNone, the finish term is 0. - The
1000 ×penalty puts any state with conflicts or cycles behind every state without them. - Finish delay and overload are on the same scale when the overload basis follows
config.duration_unit: one day late weighs about as much as one resource-day over capacity.
The formula is fixed. To rank by other criteria, compare the raw fields instead of cost.
Example#
Score one candidate that assigns a second task to the same resource, then print the metrics of the baseline and of the candidate.
use ;
Related#
EvaluateResult- holds the baseline metrics and every candidate'sCandidateResult- whosecostcomes from these metricsEvaluateOptions-focusandlevelcontrol what is measured- Evaluating Alternatives - reading metrics and cost to rank candidates
- Suggesting assignments - the same metrics scoring proposal steps