tutorials:batch

Batch Optimization using the Command Line

Command-line Interface

If you need to automate multiple optimizations, you can use the sconecmd, the SCONE command-line interface. By default, it is located in C:\Program Files\SCONE\sconecmd.exe, and can be used as follows:

"C:\Program Files\SCONE\sconecmd.exe" -o "your_scenario.scone"

You can change any setting in your .scone scenario by specifying it in the command line, for example:

"C:\Program Files\SCONE\bin\sconecmd.exe" -o "scenario.scone" CmaOptimizer.random_seed=10

Batch Optimizations

You can also create a Windows .bat file which contains multiple commands:

set SCONECMD="C:\Program Files\SCONE\bin\sconecmd.exe"
%SCONECMD% -o "scenario.scone" CmaOptimizer.random_seed=10
%SCONECMD% -o "scenario.scone" CmaOptimizer.SimulationObjective.ModelOpenSim3.model_file=data/model.osim

If you wish to run multiple optimizations in parallel, you can do so by prefixing your command with start. The first argument after start (“SCONE”) is the title of the console window that is spawned.

set SCONECMD="C:\Program Files\SCONE\bin\sconecmd.exe"
start "SCONE" %SCONECMD% -o "scenario.scone" CmaOptimizer.random_seed=10
start "SCONE" %SCONECMD% -o "scenario.scone" CmaOptimizer.SimulationObjective.ModelOpenSim3.model_file=data/model.osim

Optimize All Scenarios in a Folder

The following .bat script can be used to evaluate all .scone scenarios in the current directory:

set SCONECMD="C:\Program Files\SCONE\bin\sconecmd.exe"
for %%f in (*.scone) do (
	start "%%f" %SCONECMD% -o "%%f"
	timeout 1
)