R: Add a new element to an optimization path.

addOptPathEl {ParamHelpers} | R Documentation

## Add a new element to an optimization path.

### Description

Changes the argument in-place. Note that when adding parameters that have associated transformations, it is probably best to add the untransformed values to the path. Otherwise you have to switch off the feasibility check, as constraints might now not hold anymore.

Dependent parameters whose requirements are not satisfied must be represented by a scalar NA in the input.

### Usage

    addOptPathEl(op, x, y, dob = getOptPathLength(op) + 1L,
      eol = as.integer(NA), error.message = NA_character_,
      exec.time = NA_real_, extra = NULL,
      check.feasible = !op$add.transformed.x)

### Arguments

`op` | [`OptPath`] Optimization path.
`x` | [`list`] List of parameter values for a point in input space. Must be in same order as parameters.
`y` | [`numeric`] Vector of fitness values. Must be in same order as `y.names`.
`dob` | [`integer(1)`] Date of birth of the new parameters. Default is length of path + 1.
`eol` | [`integer(1)`] End of life of point. Default is `NA`.
`error.message` | [`character(1)`] Possible error message that occurred for this parameter values. Default is `NA`.
`exec.time` | [`numeric(1)`] Possible exec time for this evaluation. Default is `NA`.
`extra` | [`list`] Possible list of extra values to store. The list must be fully named. The list can contain nonscalar values, but these nonscalar entries must have a name starting with a dot (`.`). Other entries must be scalar, and must be in the same order of all calls of `addOptPathEl`. Watch out: if `include.extra` was set to `TRUE` in `makeOptPathDF` the list of extras is mandatory. Default is `NULL`.
`check.feasible` | [`logical(1)`] Should `x` be checked with `isFeasible`? Default is `TRUE`.

### Value

Nothing.

### See Also

Other optpath: `OptPath`, `getOptPathBestIndex`, `getOptPathCols`, `getOptPathCol`, `getOptPathDOB`, `getOptPathEOL`, `getOptPathEl`, `getOptPathErrorMessages`, `getOptPathExecTimes`, `getOptPathLength`, `getOptPathParetoFront`, `getOptPathX`, `getOptPathY`, `setOptPathElDOB`, `setOptPathElEOL`

### Examples

    ps = makeParamSet(
      makeNumericParam("p1"),
      makeDiscreteParam("p2", values = c("a", "b"))
    )
    op = makeOptPathDF(par.set = ps, y.names = "y", minimize = TRUE)
    addOptPathEl(op, x = list(p1 = 7, p2 = "b"), y = 1)
    addOptPathEl(op, x = list(p1 = -1, p2 = "a"), y = 2)
    as.data.frame(op)

[Package ParamHelpers version 1.12 Index]