R: Assertion for bbotk objects

bbotk_assertions {bbotk} | R Documentation

## Assertion for bbotk objects

### Description

Most assertion functions ensure the right class attribute, and optionally additional properties. Additionally, the following compound assertions are implemented:

- `assert_terminable(terminator, instance)`
  (Terminator, OptimInstance) -> `NULL`
  Checks if the terminator is applicable to the optimization.

- `assert_instance_properties(optimizer, instance)`
  (Optimizer, OptimInstance) -> `NULL`
  Checks if the instance is applicable to the optimizer.

If an assertion fails, an exception is raised. Otherwise, the input object is returned invisibly.

### Usage

    assert_terminator(terminator, instance = NULL)

    assert_terminable(terminator, instance)

    assert_set(x, empty = TRUE, .var.name = vname(x))

    assert_optimizer(optimizer)

    assert_instance_properties(optimizer, inst)

### Arguments

`terminator` | (Terminator).
`instance` | (OptimInstance).
`x` | (any)
`empty` | (`logical(1)`)
`.var.name` | (`character(1)`)
`optimizer` | (Optimizer).

[Package bbotk version 0.5.0 Index]