GapBehavior#

Selects how auto-scheduled tasks are placed relative to their links: kept at their current (preferred) dates where the links allow it, or pulled to the earliest position. It's the type of SchedulingConfig::gap_behavior, where the default is GapBehavior::Preserve.

Declaration#

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum GapBehavior {
    Preserve,
    Compress,
}

With the serde feature, the enum implements Serialize and Deserialize and uses the lowercase spellings "preserve" and "compress".

Variants#

Variant Description
Preserve A task keeps its current dates unless a link or constraint pushes it. Gaps between linked tasks stay as they are.
Compress Every auto-scheduled task moves to the earliest position its links and constraints allow, closing gaps. Summaries don't move as blocks: their links apply to the leaf tasks, as with move_projects: false.

Example#

use plen_core::{GapBehavior, SchedulingConfig};

fn main() {
    let config = SchedulingConfig {
        gap_behavior: GapBehavior::Compress,
        ..Default::default()
    };
    assert_eq!(config.gap_behavior, GapBehavior::Compress);
    assert_eq!(SchedulingConfig::default().gap_behavior, GapBehavior::Preserve);
}