diff --git a/examples/scheduling/src/problem.rs b/examples/scheduling/src/problem.rs index d3f842ac..20caee81 100644 --- a/examples/scheduling/src/problem.rs +++ b/examples/scheduling/src/problem.rs @@ -5,6 +5,7 @@ use aries::model::lang::linear::LinearSum; use aries::model::lang::max::{EqMax, EqMin}; use aries::model::lang::{IAtom, IVar}; use itertools::Itertools; +use std::fmt::{Debug, Formatter}; #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[allow(clippy::enum_variant_names)] @@ -137,7 +138,7 @@ pub struct Operation { end: IAtom, } -#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] +#[derive(Copy, Clone, Eq, PartialEq, Hash)] pub struct OperationId { pub job: u32, pub op: u32, @@ -146,6 +147,17 @@ pub struct OperationId { pub alt: Option, } +impl Debug for OperationId { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "({}, {}, ", self.job, self.op)?; + if let Some(alt) = self.alt { + write!(f, "{alt})") + } else { + write!(f, ")") + } + } +} + /// Represents one alternative to an operation #[derive(Clone)] pub struct OperationAlternative {