Crate metaheuristics_nature[][src]

Expand description

A collection of nature-inspired meta-heuristic algorithms.

Algorithm

There are two traits Algorithm and Setting (setting!). The previous is used to design the optimization method, and the latter is the setting interface.

Solver is a simple interface for obtaining the solution, or analyzing the result. This type allows you to use the API without importing any traits.

All provided methods are listed in the module methods.

Objective Function

You can define your question as a objective function through implementing ObjFunc.

First of all, the array types are ndarray::ArrayBase. And then you should define the upper bound, lower bound, and objective function ObjFunc::fitness by yourself.

The final answer is ObjFunc::result, which is generated from the design parameters.

Random Function

This crate use 32bit PRNG algorithm to generate random value, before that, a random seed is required. The seed is generated by getrandom, please see its support platform.

Features

  • std: Default feature. Enable standard library function, such as timing and threading.
  • parallel: Enable parallel function, let objective function running without ordered, uses std::thread::spawn. Disable it for the platform that doesn’t supported threading, or if your objective function is not complicate enough. This feature required std.
  • wasm: Support for webassembly, especial for random seed generating.

Re-exports

pub use crate::methods::*;

Modules

Pre-implemented optimization methods.

The random function for building algorithm.

This module provides a thread pool to spawn the objective function and collect the results.

The utility API used to create a new algorithm.

Macros

Define a data structure and its builder functions.

Structs

The data of generation sampling.

A public API for using optimization methods.

Enums

The terminal condition of the algorithm setting.

Traits

The base of the objective function.