#wheel #genetic-algorithm #random #selection #little #fitness #proportionate

random-wheel

A little implementation of random wheels (used in genetic algorithm for selection)

23 releases

Uses old Rust 2015

0.3.1 Mar 15, 2016
0.3.0 Mar 15, 2016
0.2.13 Mar 14, 2016
0.2.1 Jul 14, 2015
0.1.7 Jul 13, 2015

#15 in #fitness

Download history 3/week @ 2024-03-16 1/week @ 2024-03-23 16/week @ 2024-03-30 3/week @ 2024-04-06 3/week @ 2024-05-18 2/week @ 2024-05-25

58 downloads per month
Used in calco

AML license

13KB
159 lines

random-wheel-rs Build Status

A little implementation of random wheels (used in genetic algorithm for selection)

Documentation


lib.rs:

A Little implementation of the random-wheel principle, RandomWheel<T>. https://wikipedia.org/wiki/Fitness_proportionate_selection

Fitness proportionate selection

Usage

You can get this package on the crates.io/random-wheel page.

Examples

You can explicitly create a RandomWheel<T> with new():

use random_wheel::RandomWheel;

let rw: RandomWheel<u8> = RandomWheel::new();

You can push values onto the random-wheel (which will grow the wheel as needed):

Popping values works in much the same way:

use random_wheel::RandomWheel;

let mut rw = RandomWheel::new();

rw.push(5., 'a');
rw.push(1., 'b');

// you have 5 chances out of 6 to pop 'a'
let a_or_b = rw.pop();

Dependencies

~315–540KB