Skip to contents

Register an algorithm implementation under a stage contract

Usage

register_strategy(contract, name, constructor, replace = FALSE, reason = NULL)

Arguments

contract

character contract class name (e.g. "Decomposer")

name

character unique implementation name

constructor

R closure with signature function(params_list) returning a contract-class instance. Primitive functions are unsupported because their implementation state cannot satisfy the registry fingerprint contract.

replace

logical; whether to deliberately replace a different constructor already registered under the same key. Re-registering a fingerprint-equivalent constructor, with the same code and behavior-relevant captured state, is an idempotent no-op.

reason

non-empty character rationale required when replace is TRUE; retained in registry provenance.

Value

invisible NULL