Optimization Experiments

How to use HASH to optimize your simulation's parameters

Often, when running an experiment, you don't necessarily want to see every simulation's outcomes, you want to find the best ones, the parameters that optimize a desired metric. With HASH's optimization engine, you can automatically generate simulations and find the set of parameters that will maximize or minimize a metric.

Optimization experiments can only be run on hCloud

Creating Optimization Experiments

To create an optimization experiment, first create the metric that represents the value you want to optimize.

For example, in Sugarscape, you might be interested in what parameters will optimize the average sugar of cells. In that case you can use the existing metric:

Metric defined in Sugarscape

Now use the experiment wizard to create a new experiment and fill in the options:

  • Select optimization as the type.

  • Use the metric name you previously defined as the metric.

  • Decide whether to maximize or minimize the objective.

  • Select the fields (globals) that will be varied.

You can save without running or save and run immediately in hCloud.

To run a simulation in hCloud, you must first set the Behavior Keys of your simulations behaviors.

While the optimization experiment is running, individual runs will populate the experiment queue in the activity sidebar. Hover over a run to see the metrics value and the parameters for that particular run.

In-progress optimization run

When the optimization run completes, the best run - the run where the parameters maximized or minimized the metric - will be highlighted.