Learn R Programming

hmsr (version 1.0.1)

rtnorm_mutation: Factory function that creates normal mutation function

Description

Given the domain bounds and standard deviation returns a function compatible with GA interface that performs a mutation on the given individual using truncated normal distribution.

Usage

rtnorm_mutation(lower, upper, sd)

Value

Function that takes two parameters (the GA object object

and an individual to perform the mutation on parent) and returns a new individual that is the result of normal mutation applied to the parent.

Arguments

lower
  • Lower bound of the problem's domain

upper
  • Upper bound of the problem's domain

sd
  • Standard deviation of the truncated normal distribution used for the mutation

Examples

Run this code
mutation <- rtnorm_mutation(
  lower = rep(-500, 5),
  upper = rep(500, 5),
  sd = rep(50, 5)
)

Run the code above in your browser using DataLab