Skip to main content

Terminal

Trait Terminal 

Source
pub trait Terminal:
    Clone
    + Send
    + Sync
    + PartialEq
    + Debug
    + Serialize
    + for<'de> Deserialize<'de>
    + 'static {
    // Required methods
    fn random<R: Rng>(rng: &mut R) -> Self;
    fn terminals() -> &'static [Self];
    fn evaluate(&self, variables: &[f64]) -> f64;
    fn to_string(&self) -> String;
}
Expand description

Trait for terminal nodes in GP trees

Required Methods§

Source

fn random<R: Rng>(rng: &mut R) -> Self

Generate a random terminal

Source

fn terminals() -> &'static [Self]

Get the set of available terminals

Source

fn evaluate(&self, variables: &[f64]) -> f64

Evaluate this terminal with the given variable bindings

Source

fn to_string(&self) -> String

Convert to string representation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§