irace (version 3.1)

readParameters: readParameters

Description

readParameters reads the parameters to be tuned by irace from a file or directly from a character string.

Usage

readParameters(file, digits = 4, debugLevel = 0, text)

Arguments

file

(optional) Character string: the name of the file containing the definitions of theparameters to be tuned.

digits

The number of decimal places to be considered for the real parameters.

debugLevel

Integer: the debug level to increase the amount of output.

text

(optional) Character string: if file is not supplied and this is, then parameters are read from the value of text via a text connection.

Value

A list containing the definitions of the parameters read. The list is structured as follows:

  • namesVector that contains the names of the parameters.

  • typesVector that contains the type of each parameter 'i', 'c', 'r', 'o'. Numerical parameters can be sampled in a log-scale with 'i,log' and 'r,log' (no spaces).

  • switchesVector that contains the switches to be used for the parameters on the command line.

  • domainList of vectors, where each vector may contain two values (minimum, maximum) for real and integer parameters, or possibly more for categorical parameters.

  • conditionsList of R logical expressions, with variables corresponding to parameter names.

  • isFixedLogical vectors that specifies which parameter is fixed and, thus, it does not need to be tuned.

  • nbParametersAn integer, the total number of parameters.

  • nbFixedAn integer, the number of parameters with a fixed value.

  • nbVariableNumber of variable (to be tuned) parameters.

Details

Either 'file' or 'text' must be given. If 'file' is given, the parameters are read from the file 'file'. If 'text' is given instead, the parameters are read directly from the 'text' character string. In both cases, the parameters must be given (in 'text' or in the file whose name is 'file') in the expected form. See the documentation for details. If none of these parameters is given, irace will stop with an error.

A fixed parameter is a parameter that should not be sampled but instead should be always set to the only value of its domain. In this function we set isFixed to TRUE only if the parameter is a categorical and has only one possible value. If it is an integer and the minimum and maximum are equal, or it is a real and the minimum and maximum values satisfy 'round(minimum, digits) == round(maximum, digits)', then the parameter description is rejected as invalid to identify potential user errors.

Examples

Run this code
# NOT RUN {
 ## Read the parameters directly from text
 parameters.table <- 'tmax "" i (2, 10)
 temp "" r (10, 50)
 '
 parameters <- readParameters(text=parameters.table)
 parameters

# }

Run the code above in your browser using DataCamp Workspace