Trait boolnetevo::Bitransform[][src]

pub trait Bitransform: Debug + Sync {
    fn id() -> String
    where
        Self: Sized
;
fn info() -> String
    where
        Self: Sized
;
fn new(prefs: &[usize]) -> Result<Box<dyn Bitransform>, String>
    where
        Self: Sized
;
fn desc(&self) -> BitransformDesc;
fn dir_inp_size(&self) -> usize;
fn inp_size(&self) -> usize;
fn outp_size(&self) -> usize;
fn dir_func(&self, args: &[u128]) -> Vec<u128>;
fn rand_inp(&self, rng: &mut ThreadRng) -> Vec<u128>;
fn score_inp_outp(&self, inp: &[u128], outp: &[u128]) -> f64; fn reg_entry(
    ) -> (String, fn() -> String, fn(_: &[usize]) -> Result<Box<dyn Bitransform>, String>)
    where
        Self: Sized
, { ... } }

Provides methods around certain bitstring function to use it for evolution of boolnet population.

Required methods

fn id() -> String where
    Self: Sized
[src]

Key to get entry about this Bitransform from BitransformRegister instance and set Evolver to this Bitransform's instance.

fn info() -> String where
    Self: Sized
[src]

Short info about this Bitransform: input, output, preferences.

fn new(prefs: &[usize]) -> Result<Box<dyn Bitransform>, String> where
    Self: Sized
[src]

Constructor, provided with bitransform's preferences.

fn desc(&self) -> BitransformDesc[src]

Make serializable description of this bitransform's preferences.

fn dir_inp_size(&self) -> usize[src]

Size of input to direct bitstring function in bits.

fn inp_size(&self) -> usize[src]

Boolnet input size in bits.

fn outp_size(&self) -> usize[src]

Boolnet output size in bits.

fn dir_func(&self, args: &[u128]) -> Vec<u128>[src]

Calculate underlying (direct) bitstring function for args batch.

fn rand_inp(&self, rng: &mut ThreadRng) -> Vec<u128>[src]

Make random input batch. The length of batch elements must be inp_size().

fn score_inp_outp(&self, inp: &[u128], outp: &[u128]) -> f64[src]

Score output batch, in regard to input batch and underlying bitstring function. Usually the score is the mean number of different bits in some 2 bitstrings.

Loading content...

Provided methods

fn reg_entry(
) -> (String, fn() -> String, fn(_: &[usize]) -> Result<Box<dyn Bitransform>, String>) where
    Self: Sized
[src]

Makes entry about this Bitransform to be added to BitransformRegister instance.

Loading content...

Implementors

Loading content...