tests/testthat/test-test_mutation.R

test_that("mutation correctly mutates offspring", {
    offspring <- c(1, 3, 0)
    mutated_offspring <- genetic.algo.optimizeR::mutation(offspring, mutation_rate = 1) # All offspring will be mutated
    expect_true(any(mutated_offspring != offspring))
})

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.