Specifying Settings
If you want to change the value for a single control setting, you can specify values for two optional parameters, «settingName» and «settingValue», to DefineOptimization(), providing the text name of the setting to «settingName», and the numeric value to «settingValue». For example, if you want to set the Scaling
parameter to 1, you would modify your call to DefineOptimization() as follows.
DefineOptimization(.., settingName: "Scaling", settingValue: 1)
To alter more than one control setting, you need to supply arrays to these parameters. The arrays passed to «settingName» and «settingValue» should have a single common index. If the index of the array passed to «settingValue» is a list of labels, where the index labels contain the name of each control setting, then you only need to include the «settingValue» parameter.
It is often convenient to specify control settings in a self-indexed edit table. The following steps illustrate this:
- Drag a variable node to your diagram, title it
Opt Settings
. - In the definition pane, set the definition type to Table.
- In the Index Chooser box, select Opt Settings (Self) as the table index.
- Click the row heading cell, and change
Item
1 toScaling
. - With the row header still selected, press down-arrow to add a row.
- Change the second row header cell to
MaxTime
. - Enter
1
into the first table body cell. - Enter
30
into the second body table cell.
- In your call to DefineOptimization(), insert a setting parameter as follows.
DefineOptimization( ..., settingValue: Opt_Settings)
The Optimizer scales parameters and terminates after 30 seconds if the optimum has not been found. A self-indexed table set up in this fashion makes it easy to adjust multiple control settings if the need arises.
See Also
Enable comment auto-refresher