Skip to main content

Function: parseBenchmarkParameters()

parseBenchmarkParameters(params: BenchmarkParameters, usage?: string, args?: string[]): BenchmarkParameters

Parse benchmark parameters from command line arguments.

Parameters

ParameterTypeDescription
paramsBenchmarkParametersInput/output argument. Contains default values of parameters

that will be overridden by command line arguments.

When not specified, empty object {} is used.
usage?stringUsage string that will be printed when -h or --help is

specified on the command line. The specified usage is followed

by description of supported benchmark and solver parameters.
args?string[]Command line arguments to parse. When not specified,

process.argv.slice(2) is used.

Returns

BenchmarkParameters

Remarks

This function parses command line arguments. In case of an error it prints an error message and terminates the program. The default parameters can be specified using parameter params.

When --help or -h is specified then the function prints the usage string followed by description of supported benchmark and engine parameters, and then terminates the program.

The description of supported parameters looks like this:

Benchmarking options:
--nbSeeds uint32 Test models on given number of random seeds
--nbParallelRuns uint32 Run given number of solves in parallel
--minObjective double Require given minimum objective value
--maxObjective double Require given maximum objective value
--dontSolve Not really solve. Useful e.g. with --exportJSON

Overall benchmarking output:
--output fileName Write detailed results of all runs into a JSON file
--summary fileName Write summary table of all runs into a CSV file
--dontOutputSolutions Do not write solutions into the output file (save space)

Outputs for individual benchmarking runs:
--result fileNamePattern Write detailed result into JSON file
--log fileNamePattern Write log into specified text file
--exportJSON fileNamePattern Export problem into a JSON file
--exportTxt fileNamePattern Export problem into a text file
--exportDomains fileNamePattern Export domains after propagate into a text file
Where fileNamePattern undergo the following expansion:
{name} -> Model name (by convention name of the source data file)
{flat_name} -> Like {name} but all characters '/' is replaced by '_'
{seed} -> Random seed
Solver path:
--solverPath string Path to the solver

Terminal output:
--color Never|Auto|Always Whether to colorize output to the terminal

Major options:
--nbWorkers uint32 Number of threads dedicated to search
--searchType LNS|FDS|FDSLB|SetTimes
Type of search to use
--randomSeed uint32 Random seed
--logLevel uint32 Level of the log
--warningLevel uint32 Level of warnings
--logPeriod double How often to print log messages (in seconds)
--verifySolutions bool When on, correctness of solutions is verified

...

WorkerParameters can be specified for individual workers using --workerN. prefix, and also for worker ranges using --workerN-M. prefix. For example:

  • --worker0.searchType FDS sets the search type for the first worker only.
  • --worker4-8.noOverlapPropagationLevel 4 sets propagation level of noOverlap constraint for workers 4, 5, 6, 7 and 8.

See