Skip to main content

dpm_schedule/
error.rs

1use dpm_model::{ValidationError, WorkItemId};
2use thiserror::Error;
3#[derive(Debug, Error)]
4/// Invalid schedule input or non-finite schedule arithmetic.
5pub enum ScheduleError {
6    /// Plan invariants are invalid.
7    #[error(transparent)]
8    Validation(#[from] ValidationError),
9    /// Finite inputs overflowed during schedule arithmetic.
10    #[error("schedule arithmetic overflow for work {0}")]
11    ArithmeticOverflow(WorkItemId),
12    #[error("dependency references missing work item {0}")]
13    /// A dependency refers to work outside the plan.
14    MissingWorkItem(WorkItemId),
15    #[error("dependency graph contains a cycle")]
16    /// Temporal constraints form a directed cycle.
17    DependencyCycle,
18    #[error("invalid duration for work item {0}")]
19    /// An activity has a missing, negative, or non-finite duration.
20    InvalidDuration(WorkItemId),
21    #[error("schedule position {0} is outside the compiled dependency network")]
22    /// A position read from a compiled network has no activity; the projection is inconsistent.
23    UnknownPosition(usize),
24    #[error("the projection needs working time beyond the supported calendar range")]
25    /// A calendar has no working time within the range a projection can compile.
26    CalendarRange,
27    #[error("review delay {0} h must be finite and non-negative")]
28    /// A requested review delay is negative or not finite.
29    InvalidReviewDelay(f64),
30    #[error("simulation requires at least one iteration")]
31    /// At least one Monte Carlo iteration is required.
32    NoSimulationIterations,
33}