tests/testthat/test-test_crossover.R

test_that("crossover generates correct number of offspring", {
    selected_parents <- c(1, 3)
    offspring <- genetic.algo.optimizeR::crossover(selected_parents, offspring_size = 2)
    expect_equal(length(offspring), 2)
})

Try the genetic.algo.optimizeR package in your browser

Any scripts or data that you put into this service are public.

genetic.algo.optimizeR documentation built on Oct. 10, 2024, 5:07 p.m.