pub struct StochasticProcessTree {
pub activity_key: ActivityKey,
pub tree: Vec<Node>,
pub transition2node: Vec<usize>,
pub weights: Vec<Fraction>,
pub termination_weight: Fraction,
}Fields§
§activity_key: ActivityKey§tree: Vec<Node>§transition2node: Vec<usize>§weights: Vec<Fraction>§termination_weight: FractionImplementations§
Source§impl StochasticProcessTree
impl StochasticProcessTree
pub fn node_to_lpn( &self, node: usize, net: &mut LabelledPetriNet, translator: &ActivityKeyTranslator, source: usize, sink: usize, ) -> Result<usize>
Source§impl StochasticProcessTree
impl StochasticProcessTree
pub fn get_number_of_nodes(&self) -> usize
pub fn get_node(&self, node: usize) -> Option<&Node>
pub fn root(&self) -> usize
pub fn get_node_of_transition( &self, transition: TransitionIndex, ) -> Result<&Node>
Sourcepub fn get_parent(&self, node: usize) -> Option<(usize, usize)>
pub fn get_parent(&self, node: usize) -> Option<(usize, usize)>
Returns the parent of node. Notice that this is an expensive operation; avoid if possible.
@param node @return The parent of node, and the rank of the child
Sourcepub fn get_child_rank_with(
&self,
parent: usize,
grand_child: usize,
) -> Option<usize>
pub fn get_child_rank_with( &self, parent: usize, grand_child: usize, ) -> Option<usize>
@param parent @param grandChild @return The number of the child within parent that contains grandChild. If grandChild is not a child of parent, will return -1.
pub fn get_children(&self, node: usize) -> StochasticChildrenIterator<'_> ⓘ
pub fn get_parents(&self, node: usize) -> StochasticParentsIterator<'_> ⓘ
pub fn get_descendants(&self, node: usize) -> &[Node]
Sourcepub fn is_parent_of(&self, parent: usize, child: usize) -> bool
pub fn is_parent_of(&self, parent: usize, child: usize) -> bool
@param parent @param child @return Whether the child is a direct or indirect child of parent.
Sourcepub fn traverse(&self, node: usize) -> usize
pub fn traverse(&self, node: usize) -> usize
Find the next node of this node: the next sibling, and if that is not available, the next sibling up the tree. May return a non-existing node if there is no sibling.
pub fn get_child(&self, parent: usize, child_rank: usize) -> usize
pub fn get_number_of_children(&self, parent: usize) -> Option<usize>
pub fn node_to_transition(&self, node: usize) -> Option<usize>
Source§impl StochasticProcessTree
impl StochasticProcessTree
pub fn number_of_leaves(&self) -> usize
pub fn node_to_string( &self, indent: usize, node: usize, f: &mut Formatter<'_>, ) -> Result<usize>
pub fn node_to_dot( &self, graph: &mut VisualGraph, node: usize, entry: &NodeHandle, exit: &NodeHandle, ) -> usize
Trait Implementations§
Source§impl Clone for StochasticProcessTree
impl Clone for StochasticProcessTree
Source§fn clone(&self) -> StochasticProcessTree
fn clone(&self) -> StochasticProcessTree
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 StochasticProcessTree
impl Debug for StochasticProcessTree
Source§impl Display for StochasticProcessTree
impl Display for StochasticProcessTree
Source§impl Exportable for StochasticProcessTree
impl Exportable for StochasticProcessTree
Source§impl From<(ActivityKey, Vec<Node>, Vec<FractionEnum>, FractionEnum)> for StochasticProcessTree
impl From<(ActivityKey, Vec<Node>, Vec<FractionEnum>, FractionEnum)> for StochasticProcessTree
Source§impl From<StochasticProcessTree> for DeterministicFiniteAutomaton
impl From<StochasticProcessTree> for DeterministicFiniteAutomaton
Source§fn from(value: StochasticProcessTree) -> Self
fn from(value: StochasticProcessTree) -> Self
Converts to this type from the input type.
Source§impl From<StochasticProcessTree> for LabelledPetriNet
impl From<StochasticProcessTree> for LabelledPetriNet
Source§fn from(value: StochasticProcessTree) -> Self
fn from(value: StochasticProcessTree) -> Self
Converts to this type from the input type.
Source§impl From<StochasticProcessTree> for LolaNet
impl From<StochasticProcessTree> for LolaNet
Source§fn from(value: StochasticProcessTree) -> Self
fn from(value: StochasticProcessTree) -> Self
Converts to this type from the input type.
Source§impl From<StochasticProcessTree> for ProcessTree
impl From<StochasticProcessTree> for ProcessTree
Source§fn from(value: StochasticProcessTree) -> Self
fn from(value: StochasticProcessTree) -> Self
Converts to this type from the input type.
Source§impl From<StochasticProcessTree> for StochasticNondeterministicFiniteAutomaton
impl From<StochasticProcessTree> for StochasticNondeterministicFiniteAutomaton
Source§fn from(tree: StochasticProcessTree) -> Self
fn from(tree: StochasticProcessTree) -> Self
Converts to this type from the input type.
Source§impl FromStr for StochasticProcessTree
impl FromStr for StochasticProcessTree
Source§impl Graphable for StochasticProcessTree
impl Graphable for StochasticProcessTree
fn to_dot(&self) -> Result<VisualGraph>
Source§impl HasActivityKey for StochasticProcessTree
impl HasActivityKey for StochasticProcessTree
fn activity_key(&self) -> &ActivityKey
fn activity_key_mut(&mut self) -> &mut ActivityKey
Source§impl Importable for StochasticProcessTree
impl Importable for StochasticProcessTree
Source§const FILE_FORMAT_SPECIFICATION_LATEX: &str = "A stochastic process tree is a line-based structure. Lines starting with a \\# are ignored.
This first line is exactly `stochastic process tree'.
The subsequent lines contain the nodes:
Each node is either:
\\begin{itemize}
\\item A line with the word `activity' followed on the same line by a space and the label of the activity leaf. The next line contains the weight of the activity;
\\item The word `tau', followed on the next line by the weight of the leaf;
\\item The name of an operator (`sequence', `xor', `concurrent', `loop', `interleaved', or `or') on its own line.
The line thereafter contains the number of children of the node, after which the nodes are given.
An operator node must have at least one child.
\\end{itemize}
Indentation of nodes is allowed, but not mandatory.\\
The last line of the file contains the weight of termination.
For instance:
\\lstinputlisting[language=ebilines, style=boxed]{../testfiles/all_operators.sptree}"
const FILE_FORMAT_SPECIFICATION_LATEX: &str = "A stochastic process tree is a line-based structure. Lines starting with a \\# are ignored. This first line is exactly `stochastic process tree'. The subsequent lines contain the nodes: Each node is either: \\begin{itemize} \\item A line with the word `activity' followed on the same line by a space and the label of the activity leaf. The next line contains the weight of the activity; \\item The word `tau', followed on the next line by the weight of the leaf; \\item The name of an operator (`sequence', `xor', `concurrent', `loop', `interleaved', or `or') on its own line. The line thereafter contains the number of children of the node, after which the nodes are given. An operator node must have at least one child. \\end{itemize} Indentation of nodes is allowed, but not mandatory.\\ The last line of the file contains the weight of termination. For instance: \\lstinputlisting[language=ebilines, style=boxed]{../testfiles/all_operators.sptree}"
A latex piece that describes the file format.
Source§const IMPORTER_PARAMETERS: &[ImporterParameter]
const IMPORTER_PARAMETERS: &[ImporterParameter]
Defines the parameters that the importer expects.
fn import_as_object( reader: &mut dyn BufRead, parameter_values: &ImporterParameterValues, ) -> Result<EbiObject>
Source§fn import(reader: &mut dyn BufRead, _: &ImporterParameterValues) -> Result<Self>where
Self: Sized,
fn import(reader: &mut dyn BufRead, _: &ImporterParameterValues) -> Result<Self>where
Self: Sized,
Attempts to import from the reader.
The parameter_values must match the order given in
IMPORTER_PARAMETERS.fn default_importer_parameter_values() -> ImporterParameterValues
Source§impl Infoable for StochasticProcessTree
impl Infoable for StochasticProcessTree
Source§impl TranslateActivityKey for StochasticProcessTree
impl TranslateActivityKey for StochasticProcessTree
Source§fn translate_using_activity_key(&mut self, to_activity_key: &mut ActivityKey)
fn translate_using_activity_key(&mut self, to_activity_key: &mut ActivityKey)
Change the activity key of this object, by translating all mentions of activities to the new activity key (which will be updated with activity labels it did not have yet.).
This is a potentially expensive operation. If only a part of the activities will be used, then consider using an ActivityKeyTranslator directly.
The activity key of this object will be updated too, so the activity keys will be equivalent afterwards.
Source§impl TryFrom<(ProcessTree, Vec<FractionEnum>, FractionEnum)> for StochasticProcessTree
impl TryFrom<(ProcessTree, Vec<FractionEnum>, FractionEnum)> for StochasticProcessTree
Source§impl TryFrom<StochasticProcessTree> for PetriNet
impl TryFrom<StochasticProcessTree> for PetriNet
Auto Trait Implementations§
impl Freeze for StochasticProcessTree
impl RefUnwindSafe for StochasticProcessTree
impl Send for StochasticProcessTree
impl Sync for StochasticProcessTree
impl Unpin for StochasticProcessTree
impl UnsafeUnpin for StochasticProcessTree
impl UnwindSafe for StochasticProcessTree
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)
Source§impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
fn saturating_into(self) -> U
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T> ToDebugString for Twhere
T: Debug,
impl<T> ToDebugString for Twhere
T: Debug,
Source§fn to_debug_string(&self) -> String
fn to_debug_string(&self) -> String
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.