Struct metaheuristics_nature::Fx[][src]

pub struct Fx<R: Fitness, const N: usize> { /* fields omitted */ }
Expand description

A quick interface help to create objective function from a callable object.

use metaheuristics_nature::{Fx, Rga, Solver};

let f = Fx::new(|v| v[0] * v[0] + 8. * v[1] * v[1] + v[2] * v[2] + v[3] * v[3])
    .lb([-50.; 4])
    .ub([50.; 4]);
let s = Solver::build(Rga::default())
    .task(|ctx| ctx.gen == 20)
    .solve(f);

Adaptive version is FxAdaptive.

Implementations

Create objective function from a callable object.

Upper bound.

Lower bound.

Trait Implementations

The result type.

Representation of the fitness value.

Return fitness, the smaller value represents a good result. Read more

Return the final result of the problem. Read more

Get upper bound.

Get lower bound.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.