pub struct ProcessTree {
pub activity_key: ActivityKey,
pub tree: Vec<Node>,
pub transition2node: Vec<usize>,
}Fields§
§activity_key: ActivityKey§tree: Vec<Node>§transition2node: Vec<usize>Implementations§
Source§impl ProcessTree
impl ProcessTree
pub fn node_to_lpn( &self, node: usize, net: &mut LabelledPetriNet, translator: &ActivityKeyTranslator, source: usize, sink: usize, ) -> Result<usize>
Source§impl ProcessTree
impl ProcessTree
pub fn number_of_leaves(&self) -> usize
Source§impl ProcessTree
impl ProcessTree
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) -> ChildrenIterator<'_> ⓘ
pub fn get_parents(&self, node: usize) -> ParentsIterator<'_> ⓘ
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>
Trait Implementations§
Source§impl Clone for ProcessTree
impl Clone for ProcessTree
Source§fn clone(&self) -> ProcessTree
fn clone(&self) -> ProcessTree
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 ProcessTree
impl Debug for ProcessTree
Source§impl Display for ProcessTree
impl Display for ProcessTree
Source§impl Exportable for ProcessTree
impl Exportable for ProcessTree
Source§impl From<(ActivityKey, Vec<Node>)> for ProcessTree
impl From<(ActivityKey, Vec<Node>)> for ProcessTree
Source§impl From<ProcessTree> for DeterministicFiniteAutomaton
impl From<ProcessTree> for DeterministicFiniteAutomaton
Source§fn from(tree: ProcessTree) -> Self
fn from(tree: ProcessTree) -> Self
Converts to this type from the input type.
Source§impl From<ProcessTree> for LabelledPetriNet
impl From<ProcessTree> for LabelledPetriNet
Source§fn from(value: ProcessTree) -> Self
fn from(value: ProcessTree) -> Self
Converts to this type from the input type.
Source§impl From<ProcessTree> for LolaNet
impl From<ProcessTree> for LolaNet
Source§fn from(value: ProcessTree) -> Self
fn from(value: ProcessTree) -> Self
Converts to this type from the input type.
Source§impl From<ProcessTreeMarkupLanguage> for ProcessTree
impl From<ProcessTreeMarkupLanguage> for ProcessTree
Source§fn from(value: ProcessTreeMarkupLanguage) -> Self
fn from(value: ProcessTreeMarkupLanguage) -> 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 FromStr for ProcessTree
impl FromStr for ProcessTree
Source§impl Graphable for ProcessTree
impl Graphable for ProcessTree
fn to_dot(&self) -> Result<VisualGraph>
Source§impl HasActivityKey for ProcessTree
impl HasActivityKey for ProcessTree
fn activity_key(&self) -> &ActivityKey
fn activity_key_mut(&mut self) -> &mut ActivityKey
Source§impl Importable for ProcessTree
impl Importable for ProcessTree
Source§const FILE_FORMAT_SPECIFICATION_LATEX: &str = "A process tree is a line-based structure. Lines starting with a \\# are ignored.
This first line is exactly `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;
\\item The word `tau';
\\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.
For instance:
\\lstinputlisting[language=ebilines, style=boxed]{../testfiles/all_operators.ptree}"
const FILE_FORMAT_SPECIFICATION_LATEX: &str = "A process tree is a line-based structure. Lines starting with a \\# are ignored. This first line is exactly `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; \\item The word `tau'; \\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. For instance: \\lstinputlisting[language=ebilines, style=boxed]{../testfiles/all_operators.ptree}"
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 TranslateActivityKey for ProcessTree
impl TranslateActivityKey for ProcessTree
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> for PetriNet
impl TryFrom<ProcessTree> for PetriNet
Source§impl TryFrom<ProcessTree> for PetriNetMarkupLanguage
impl TryFrom<ProcessTree> for PetriNetMarkupLanguage
Auto Trait Implementations§
impl Freeze for ProcessTree
impl RefUnwindSafe for ProcessTree
impl Send for ProcessTree
impl Sync for ProcessTree
impl Unpin for ProcessTree
impl UnwindSafe for ProcessTree
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> 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> 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> 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.