Struct biodivine_lib_param_bn::Regulation
source · [−]pub struct Regulation {
pub(crate) regulator: VariableId,
pub(crate) target: VariableId,
pub(crate) observable: bool,
pub(crate) monotonicity: Option<Monotonicity>,
}
Expand description
Describes an interaction between two Variables
in a RegulatoryGraph
(or a BooleanNetwork
).
Every regulation can be monotonous, and can be set as observable:
- Monotonicity is either positive or negative and signifies that the influence of the
regulator
on thetarget
has to increase or decrease thetarget
value respectively. - If observability is set to
true
, theregulator
must have influence on the outcome of thetarget
update function in some context. If set to false, this is not enforced (i.e. theregulator
can have an influence on thetarget
, but it is not required).
Regulations can be represented as strings in the
form "regulator_name 'relationship' target_name"
. The ‘relationship’ starts with -
, which
is followed by >
for activation (positive monotonicity), |
for inhibition (negative
monotonicity) or ?
for unspecified monotonicity. Finally, an additional ?
at the end
of ‘relationship’ signifies a non-observable regulation. Together, this gives the
following options: ->, ->?, -|, -|?, -?, -??
.
Regulations cannot be created directly, they are only borrowed from a RegulatoryGraph
or a BooleanNetwork
.
Fields
regulator: VariableId
target: VariableId
observable: bool
monotonicity: Option<Monotonicity>
Implementations
sourceimpl Regulation
impl Regulation
Basic getters.
sourcepub fn is_observable(&self) -> bool
pub fn is_observable(&self) -> bool
Check if the regulation is marked as observable.
sourcepub fn get_monotonicity(&self) -> Option<Monotonicity>
pub fn get_monotonicity(&self) -> Option<Monotonicity>
Return monotonicity of the regulation (if specified).
sourcepub fn get_regulator(&self) -> VariableId
pub fn get_regulator(&self) -> VariableId
Get the VariableId
if the regulator.
sourcepub fn get_target(&self) -> VariableId
pub fn get_target(&self) -> VariableId
Get the VariableId
of the target.
sourceimpl Regulation
impl Regulation
Serialization utility methods.
sourcepub fn try_from_string(
regulation: &str
) -> Option<(String, Option<Monotonicity>, bool, String)>
pub fn try_from_string(
regulation: &str
) -> Option<(String, Option<Monotonicity>, bool, String)>
Try to read all available information about a regulation from a given string in the standard format.
The returned data correspond to the items as they appear in the string, i.e. regulator
,
monotonicity
, observability
and target
. If the string is not valid, returns None
.
sourcepub fn to_string(&self, context: &RegulatoryGraph) -> String
pub fn to_string(&self, context: &RegulatoryGraph) -> String
Convert to standard string format using variable names provided by a RegulatoryGraph
.
Trait Implementations
sourceimpl Clone for Regulation
impl Clone for Regulation
sourcefn clone(&self) -> Regulation
fn clone(&self) -> Regulation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Regulation
impl Debug for Regulation
sourceimpl Hash for Regulation
impl Hash for Regulation
sourceimpl PartialEq<Regulation> for Regulation
impl PartialEq<Regulation> for Regulation
sourcefn eq(&self, other: &Regulation) -> bool
fn eq(&self, other: &Regulation) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Regulation) -> bool
fn ne(&self, other: &Regulation) -> bool
This method tests for !=
.
impl Eq for Regulation
impl StructuralEq for Regulation
impl StructuralPartialEq for Regulation
Auto Trait Implementations
impl RefUnwindSafe for Regulation
impl Send for Regulation
impl Sync for Regulation
impl Unpin for Regulation
impl UnwindSafe for Regulation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more