cptgaControl: Build Control List for 'cptga'/'cptgaisl'

View source: R/gareg_knots.R

cptgaControlR Documentation

Build Control List for cptga/cptgaisl

Description

Convenience constructor for GA control parameters used by changepointGA::cptga and changepointGA::cptgaisl. It merges named overrides into engine-specific defaults (.cptga.default or .cptgaisl.default), with light validation.

Usage

cptgaControl(
  ...,
  .list = NULL,
  .persist = FALSE,
  .env = asNamespace("GAReg"),
  .validate = TRUE,
  engine = NULL
)

Arguments

...

Named overrides for control fields (e.g., popSize, pcrossover, minDist, numIslands).

.list

Optional named list of overrides (merged with ...).

.persist

Logical; if TRUE, persist updated defaults back into the target environment (not usually recommended in user code).

.env

Environment where defaults live (defaults to parent.frame()).

.validate

Logical; validate values/ranges (default TRUE).

engine

Character; one of "cptga" or "cptgaisl" to select the default set and validation rules.

Details

Unknown names are rejected. When both ... and .list are present, they are combined, with later entries overwriting earlier ones.

Value

A list of class "cptgaControl".

See Also

gareg_knots, .cptga.default, .cptgaisl.default


GAReg documentation built on March 29, 2026, 5:08 p.m.