Struct pso_rs::model::Model[][src]

pub struct Model {
    pub config: Config,
    pub flat_dim: usize,
    pub population: Population,
    pub population_f_scores: Vec<f64>,
    pub x_best: Particle,
    pub f_best: f64,
    // some fields omitted
}
Expand description

Model struct

It takes in a Config instance and fn pointer to an objective function and defines a run method for running Particle Swarm Optimization.

Fields

config: Configflat_dim: usizepopulation: Populationpopulation_f_scores: Vec<f64>x_best: Particlef_best: f64

Implementations

Computes the value of the objective function for each particle and updates best found

Returns the objective function values for all particles

Uses the rayon crate for parallel computation

Returns the best found objective function value

Returns the best found minimizer

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 alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

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.