pub struct TransitionMatrix {
pub name: String,
pub resource_id: String,
pub default_ms: i64,
/* private fields */
}Expand description
Sequence-dependent setup time matrix.
Maps (from_category, to_category) → setup time in ms. Used when the setup time on a resource depends on what was processed previously (e.g., machine changeover, color change).
§Reference
Allahverdi et al. (2008), “A survey of scheduling problems with setup times or costs”
Fields§
§name: StringMatrix identifier.
resource_id: StringResource this matrix applies to.
default_ms: i64Default setup time when no explicit transition is defined.
Implementations§
Source§impl TransitionMatrix
impl TransitionMatrix
Sourcepub fn new(name: impl Into<String>, resource_id: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, resource_id: impl Into<String>) -> Self
Creates a new transition matrix for a resource.
Sourcepub fn with_default(self, default_ms: i64) -> Self
pub fn with_default(self, default_ms: i64) -> Self
Sets the default transition time.
Sourcepub fn set_transition(
&mut self,
from: impl Into<String>,
to: impl Into<String>,
time_ms: i64,
)
pub fn set_transition( &mut self, from: impl Into<String>, to: impl Into<String>, time_ms: i64, )
Defines a transition time between two categories.
Sourcepub fn get_transition(&self, from: &str, to: &str) -> i64
pub fn get_transition(&self, from: &str, to: &str) -> i64
Gets the transition time between two categories.
Returns the explicit time if defined, otherwise the default. Same-category transitions return 0 unless explicitly set.
Sourcepub fn transition_count(&self) -> usize
pub fn transition_count(&self) -> usize
Number of explicitly defined transitions.
Trait Implementations§
Source§impl Clone for TransitionMatrix
impl Clone for TransitionMatrix
Source§fn clone(&self) -> TransitionMatrix
fn clone(&self) -> TransitionMatrix
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransitionMatrix
impl Debug for TransitionMatrix
Source§impl<'de> Deserialize<'de> for TransitionMatrix
impl<'de> Deserialize<'de> for TransitionMatrix
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TransitionMatrix
impl RefUnwindSafe for TransitionMatrix
impl Send for TransitionMatrix
impl Sync for TransitionMatrix
impl Unpin for TransitionMatrix
impl UnsafeUnpin for TransitionMatrix
impl UnwindSafe for TransitionMatrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more