[][src]Struct pso::PSO

pub struct PSO { /* fields omitted */ }

Particle Swarm Optimizer

Base struct to run optimization jobs using Particle Swarms and an objective function

Implementations

impl PSO[src]

pub fn from_swarm_configs(
    verbose: bool,
    swarm_configs: Vec<SwarmConfig>
) -> Self
[src]

Generate a PSO from a list of Swarm Configuartions

pub fn from_swarm_config(
    num_swarms: usize,
    verbose: bool,
    swarm_config: &SwarmConfig
) -> Self
[src]

Generate a PSO with num_swarms swarms using the given Swarm Configuration

pub fn default(num_swarms: usize, verbose: bool) -> Self[src]

Generate a PSO with num_swarms swarms using the default Swarm Configuration

pub fn run_job<F>(
    &self,
    job_config: JobConfig,
    objective_function: F
) -> (f64, Vec<f64>) where
    F: Fn(&[f64]) -> f64 + Clone + Sync + Send + 'static, 
[src]

Run an optimization with the given Job Configuration and Objective Function

Returns a tuple with the minimum cost and corresponding location in the search space

This function clones the objective function for each swarm before sharing it across threads. This is a performance consideration to reduce the shared use of data within the objective function across multiple threads. It also allows the objective function to internally mutate itself (the function does not have to be Sync+Send)

Trait Implementations

impl Clone for PSO[src]

impl Debug for PSO[src]

Auto Trait Implementations

impl RefUnwindSafe for PSO

impl Send for PSO

impl Sync for PSO

impl Unpin for PSO

impl UnwindSafe for PSO

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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