pub struct Regulation {
    regulator: VarId,
    target: VarId,
    essential: Essentiality,
    regulation_sign: Monotonicity,
}
Expand description

Describes an interaction between two variables, regulator and target. Every regulation can be monotonous and can be set as essential:

Monotonicity is positive, negative, dual, or unknown. The monotonicity signifies how the presence of the regulator affects the value of the target:

  • if the regulation is positive, it might only increase the target value
  • if the regulation is negative, it might only decrease the target value
  • if the regulation is dual, it might both increase or decrease the target value (in different contexts)

If essentiality is set to true, the regulator must have influence on the outcome of the target update function in some context. If set to False, this regulation must have no effect. If it is Unknown, the essentiality is not enforced (i.e. the regulator can have an influence on the target, 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), * for dual effect (non-monotonic) or ? for unspecified monotonicity. Finally, an additional X, ? at the end of ‘relationship’ signifies that the the regulation is non-essential (non-essential) or the essentiality is unknown, respectively. Together, this gives the following options: ->, ->?, -|, -|?, -*, -*?, -?, -??.

Fields§

§regulator: VarId§target: VarId§essential: Essentiality§regulation_sign: Monotonicity

Implementations§

source§

impl Regulation

Methods for safely generating new Regulations.

source

pub fn new( regulator: VarId, target: VarId, essential: Essentiality, regulation_sign: Monotonicity, ) -> Regulation

Create new Regulation given all the components.

source

pub fn try_from_string(regulation_str: &str) -> Result<Regulation, String>

Try to read the regulation from a given string in the standard format. Returns error if the string is invalid.

source

pub fn try_components_from_string( regulation_str: &str, ) -> Result<(String, Monotonicity, Essentiality, String), 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, regulation_sign, essentiality and target. If the string is not valid, returns None.

source§

impl Regulation

Basic getters and other non-modifying methods.

source

pub fn is_essential(&self) -> bool

Check if the regulation is marked as essential.

Note that both negative or unknown essentiality results in false.

source

pub fn get_essentiality(&self) -> &Essentiality

Get the essentiality of the regulation.

source

pub fn get_sign(&self) -> &Monotonicity

Get the sign of the regulation.

source

pub fn get_regulator(&self) -> &VarId

Get the VarId of the regulator.

source

pub fn get_target(&self) -> &VarId

Get the VarId of the target.

source§

impl Regulation

Methods for editing Regulations.

source

pub fn swap_regulator(&mut self, new_regulator: VarId)

Directly swap original regulator with a given one.

source

pub fn swap_target(&mut self, new_target: VarId)

Directly swap original target with a given one.

source

pub fn swap_sign(&mut self, new_sign: Monotonicity)

Directly swap original sign with a given one.

source

pub fn swap_essentiality(&mut self, new_essentiality: Essentiality)

Directly swap original essentiality with a given one.

Trait Implementations§

source§

impl Clone for Regulation

source§

fn clone(&self) -> Regulation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Regulation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Regulation

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Regulation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Standard format that can be parsed back.

source§

impl Hash for Regulation

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Regulation

source§

fn eq(&self, other: &Regulation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Regulation

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Regulation

source§

impl StructuralPartialEq for Regulation

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the [CommandItem]. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,