[][src]Struct vrp_core::solver::Builder

pub struct Builder {
    pub max_generations: Option<usize>,
    pub max_time: Option<usize>,
    pub cost_variation: Option<(usize, f64)>,
    pub config: EvolutionConfig,
}

Provides configurable way to build solver.

Fields

max_generations: Option<usize>max_time: Option<usize>cost_variation: Option<(usize, f64)>config: EvolutionConfig

Implementations

impl Builder[src]

pub fn new(problem: Arc<Problem>) -> Self[src]

impl Builder[src]

pub fn with_max_generations(self, limit: Option<usize>) -> Self[src]

Sets max generations to be run. Default is 2000.

pub fn with_cost_variation(self, variation: Option<(usize, f64)>) -> Self[src]

Sets cost variation termination criteria. Default is None.

pub fn with_max_time(self, limit: Option<usize>) -> Self[src]

Sets max running time limit. Default is 300 seconds.

pub fn with_initial_methods(
    self,
    initial_methods: Vec<(Box<dyn Recreate>, usize)>
) -> Self
[src]

Sets initial methods.

pub fn with_solutions(self, solutions: Vec<Arc<Solution>>) -> Self[src]

Sets initial solutions. Default is none.

pub fn with_population_size(self, size: usize) -> Self[src]

Sets population size. Default is 4.

pub fn with_offspring_size(self, size: usize) -> Self[src]

Sets offspring size. Default is 4.

pub fn with_elite_size(self, size: usize) -> Self[src]

Sets elite size. Default is 2.

pub fn with_initial_size(self, size: usize) -> Self[src]

Sets initial population size. Each initial individual is constructed separately which used to take more time than normal refinement process. Default is 2.

pub fn with_mutation(self, mutation: Box<dyn Mutation>) -> Self[src]

Sets mutation algorithm. Default is ruin and recreate.

pub fn with_termination(self, termination: Box<dyn Termination>) -> Self[src]

Sets termination algorithm. Default is max time and max generations.

pub fn build(self) -> Result<Solver, String>[src]

Builds solver with parameters specified.

Auto Trait Implementations

impl !RefUnwindSafe for Builder

impl !Send for Builder

impl !Sync for Builder

impl Unpin for Builder

impl !UnwindSafe for Builder

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, 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>,