Function: parseBenchmarkParameters()
parseBenchmarkParameters(
params
:BenchmarkParameters
,args
:string
[]):BenchmarkParameters
Parse benchmark parameters from command line arguments.
Parameters
Parameter | Type | Description |
---|---|---|
params | BenchmarkParameters | Input/output argument. Contains default values of parameters that will be overridden by command line arguments. When not specified, empty object {} is used. |
args | string [] | Command line arguments to parse. When not specified, process.argv.slice(2) is used. |
Returns
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 the parameter params
.
When --help
or -h
is specified, then the function prints the params.usage
string followed by the 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 the 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 a 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 a detailed result into a JSON file
--log fileNamePattern Write log into the specified text file
--exportJSON fileNamePattern Export problem into a JSON file
--exportTxt fileNamePattern Export problem into a text file
Where fileNamePattern undergoes 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 to the first worker only.--worker4-8.noOverlapPropagationLevel 4
sets the propagation level ofnoOverlap
constraint for workers 4, 5, 6, 7, and 8.
See
- parseSomeBenchmarkParameters for a version that allows unrecognized arguments.
- Functions parseParameters and parseSomeParameters for parsing only solver parameters.