LevelingOrder#

Selects how leveling picks the task that moves when several tasks compete for an overallocated resource. It's the type of LevelingOptions::order. The default is LevelingOrder::Standard.

Declaration#

#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum LevelingOrder {
    Id,
    #[default]
    Standard,
    Priority,
}

With the serde feature, the variants serialize as "id", "standard" and "priority".

Variants#

Variant Description
Id A task already running stays where possible; among the rest, the task later in input order moves.
Standard Default. A task already running stays where possible, then the MS Project standard chain decides: dependency, total slack, start date, priority, constraints, input order.
Priority Lower TaskData::priority moves first, even when that task is already running. Equal priorities fall through to Standard.

Every order ends with the same tie-break, so the result is deterministic. For the full rules, see Leveling resources.

Example#

use plen_core::{LevelingOptions, LevelingOrder};

fn main() {
    let options = LevelingOptions {
        order: LevelingOrder::Priority,
        ..LevelingOptions::default()
    };
    assert_eq!(LevelingOptions::default().order, LevelingOrder::Standard);
    assert_eq!(options.order, LevelingOrder::Priority);
}