Learn R Programming

nlmixr2auto (version 1.0.0)

is_move_tabu: Check if a move is tabu

Description

Given a move (variable, from-value, to-value) and a tabu list, this function checks whether the move is currently forbidden by the tabu list.

Usage

is_move_tabu(move, tabu_list, policy = c("attribute", "move"))

Value

Logical scalar: TRUE if the move is tabu, FALSE otherwise.

Arguments

move

A list as returned by detect_move, containing element, from, and to.

tabu_list

Data frame of tabu elements, with columns: elements (variable name), elements.value (forbidden value), and tabu.iteration.left (remaining tabu tenure).

policy

Character scalar. Tabu restriction type: "attribute" (default) or "move".

Author

Zhonghui Huang

Examples

Run this code
move <- list(element = "no.cmpt", from = 2, to = 3)
tabu_list <- data.frame(
  elements = c("no.cmpt", "eta.vc"),
  elements.value = c(3, 1),
  tabu.iteration.left = c(2, 1)
)
is_move_tabu(move, tabu_list)

Run the code above in your browser using DataLab