Struct abc::HiveBuilder [] [src]

pub struct HiveBuilder<Ctx: Context> {
    // some fields omitted
}

Manages the parameters of the ABC algorithm.

Methods

impl<Ctx: Context> HiveBuilder<Ctx>

fn new(context: Ctx, workers: usize) -> HiveBuilder<Ctx>

Creates a new hive.

  • context - Factory-like state that can be used while generating solutions.
  • workers - Number of working solution candidates to maintain at a time.

fn set_observers(self, observers: usize) -> HiveBuilder<Ctx>

Sets the number of "bees" that will pick a candidate to work on at random.

This defaults to the number of workers.

fn set_retries(self, retries: usize) -> HiveBuilder<Ctx>

Sets the number of times a candidate can go unimproved before being reinitialized.

This defaults to the number of workers.

fn set_threads(self, threads: usize) -> HiveBuilder<Ctx>

Sets the number of worker threads to use while running.

fn set_scaling(self, scale: Box<ScalingFunction>) -> HiveBuilder<Ctx>

Sets the scaling function for observers to use.

fn build(self) -> AbcResult<Hive<Ctx>>

Activates the HiveBuilder to create a runnable object.