Skip to contents

Probes the LANDIS-II console that a run is about to use and throws unless its major version is version. Exactly one of image, container or console identifies what to probe; the result is memoized per process against that key, so a pool probes once rather than once per replicate.

Usage

landis_assert_version(
  version = landis_target_version(),
  image = NULL,
  container = NULL,
  console = NULL
)

Arguments

version

Integer. Required major version. Defaults to landis_target_version(), i.e. the generation this package is built for.

image

Character. Docker image to probe with a throwaway container.

container

Character. Name of a running container to probe via docker exec.

console

Character. Path to Landis.Console.dll for a local (non-Docker) run.

Value

The detected version string (invisibly), e.g. "8.0".

Details

An undetectable version is treated as a failure, not as permission to proceed: a probe that returns nothing is indistinguishable from a console of the wrong generation that never announced itself, and proceeding is the exact failure this guards against. Set options(landisutils.skip_version_check = TRUE) to bypass the check where that is genuinely wanted – an explicit, visible opt-out rather than a silent one.