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:

  1. Drag a variable node to your diagram, title it Opt Settings.
  2. In the definition pane, set the definition type to Table.
  3. In the Index Chooser box, select Opt Settings (Self) as the table index.
  4. Click the row heading cell, and change Item 1 to Scaling.
  5. With the row header still selected, press down-arrow to add a row.
  6. Change the second row header cell to MaxTime.
  7. Enter 1 into the first table body cell.
  8. Enter 30 into the second body table cell.
7-2.png
  1. 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


Comments


You are not allowed to post comments.