Struct Evolver

Source
pub struct Evolver { /* private fields */ }
Expand description

Container of evolution process components.

Implementations§

Source§

impl Evolver

Source

pub fn arch( &mut self, height: usize, size: usize, rands: usize, layers: usize, cycles: usize, ) -> Result<(), String>

Changes boolnet architecture.

Source§

impl Evolver

Source

pub fn bitran( &mut self, register: &BitransformRegister, id: &str, prefs: &[usize], ) -> Result<(), String>

Changes Bitransform to one present in register or shows all that are there.

Source§

impl Evolver

Source

pub fn dir(&mut self, dir_inp_hex: &str) -> Result<String, String>

Calculates direct bitstring function of Bitransform for given hex-string input, as hex-string output.

Source§

impl Evolver

Source

pub fn evol(&mut self, epochs: usize) -> Result<(), String>

Evolves population until any key is pressed (epochs = 0) or for given number of epochs. Outputs to terminal and to log if logging is on.

Source§

impl Evolver

Source

pub fn help(&self, command: &str)

Lists available commands or shows usage of a command.

Source§

impl Evolver

Source

pub fn par(&mut self, param: &str, valstr: &str) -> Result<(), String>

Changes evolution parameter.

Source§

impl Evolver

Source

pub fn pop(&mut self, size: usize) -> Result<(), String>

Changes population size.

Source§

impl Evolver

Source

pub fn reset(&mut self) -> Result<(), String>

Resets population.

Source§

impl Evolver

Source

pub fn run(&mut self, bn_ind: usize, inp_hex: &str) -> Result<String, String>

Runs given boolnet with given hex-string input to obtain hex-string output.

Source§

impl Evolver

Source

pub fn save(&self, dirpath: &str) -> Result<(), String>

Saves evolver to dir. dirpath cannot start with “/” due to safety reasons.

Source

pub fn load( register: &BitransformRegister, dirpath: &str, ) -> Result<Self, String>

Loads evolver from dir.

Source§

impl Evolver

Source

pub fn set(&mut self, setting: &str, valstr: &str) -> Result<(), String>

Changes setting.

Source§

impl Evolver

Source

pub fn stat(&self) -> Result<(), String>

Shows statistics.

Source§

impl Evolver

Source

pub fn new_default(register: &BitransformRegister) -> Result<Self, String>

register must contain at least the entry about default Bitransform, InvXor.

Source

pub fn shell(&mut self, register: &BitransformRegister) -> Result<(), String>

Control evolution from basic shell. No history or autocompletion of commands… yet.

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> 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.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

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

Source§

fn vzip(self) -> V