Skip to contents

find_netlogo_version() attempts to determine the NetLogo version installed on the user's system.

Usage

find_netlogo_version()

Value

A character string specifying the NetLogo version (e.g., "7.0.3"). Returns NA if the version cannot be determined.

Details

The function uses the following detection methods in order:

  1. If the NetLogo console executable is found by find_netlogo_console(), it runs NetLogo_Console --headless --version command to retrieve the version information. This is the most reliable method.

  2. If the executable is not found, it attempts to extract the version number from the installation directory name returned by find_netlogo_home() (e.g., NetLogo 7.0.2 yields "7.0.2"). Note that this fallback may produce slightly different results if the directory was renamed or uses a non-standard naming convention.

See also

Examples

# \dontrun{
  find_netlogo_version()
#> [1] "7.0.3"
# }