1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Find an approximate solution to your optimisation problem using Random Search
//!
//! **Note: This isn't really a useful algorithm and is only included for completness.**
//!
//! At each iteration, generate an independantly random solution. When the time runs out, return
//! the best solution found.
//!
//!# Examples
//!
//!```ignore
//!let solution = metaheuristics::random_search::solve(&mut problem, runtime);
//!```
use Metaheuristics;
use ;
/// Returns an approximate solution to your optimisation problem using Random Search
///
///# Parameters
///
/// `problem` is the type that implements the `Metaheuristics` trait.
///
/// `runtime` is a `time::Duration` specifying how long to spend searching for a solution.
///
///# Examples
///
///```ignore
///let solution = metaheuristics::random_search::solve(&mut problem, runtime);
///```