Struct biodivine_sketchbook::algorithms::eval_dynamic::_attractors::itgr::Scheduler
source · struct Scheduler {
active_variables: Vec<VariableId>,
universe: GraphColoredVertices,
processes: Vec<(usize, Box<dyn Process>)>,
to_discard: Option<GraphColoredVertices>,
}
Expand description
(internal) Scheduler manages work divided into Processes
. It keeps a universe
of unprocessed vertices and a list of remaining active variables.
Fields§
§active_variables: Vec<VariableId>
§universe: GraphColoredVertices
§processes: Vec<(usize, Box<dyn Process>)>
§to_discard: Option<GraphColoredVertices>
Implementations§
source§impl Scheduler
impl Scheduler
sourcepub fn new(
initial: GraphColoredVertices,
variables: Vec<VariableId>,
) -> Scheduler
pub fn new( initial: GraphColoredVertices, variables: Vec<VariableId>, ) -> Scheduler
Create a new Scheduler
with initial universe and active variables.
sourcepub fn finalize(self) -> (GraphColoredVertices, Vec<VariableId>)
pub fn finalize(self) -> (GraphColoredVertices, Vec<VariableId>)
Finalize this scheduler, returning the current universe and active variables.
sourcepub fn discard_variable(&mut self, var: VariableId)
pub fn discard_variable(&mut self, var: VariableId)
Remove given var
from the list of active variables.
sourcepub fn discard_vertices(&mut self, set: &GraphColoredVertices)
pub fn discard_vertices(&mut self, set: &GraphColoredVertices)
Remove given set
from the universe of this scheduler.
sourcepub fn spawn<P: 'static + Process>(&mut self, process: P)
pub fn spawn<P: 'static + Process>(&mut self, process: P)
Add a new process into this scheduler.
sourcepub fn get_universe(&self) -> &GraphColoredVertices
pub fn get_universe(&self) -> &GraphColoredVertices
Get the current universe set of the scheduler.
sourcepub fn get_active_variables(&self) -> &[VariableId]
pub fn get_active_variables(&self) -> &[VariableId]
Get the list of currently active variables.
Auto Trait Implementations§
impl Freeze for Scheduler
impl !RefUnwindSafe for Scheduler
impl !Send for Scheduler
impl !Sync for Scheduler
impl Unpin for Scheduler
impl !UnwindSafe for Scheduler
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