Code Snippets

Setting Optimizer Type


Project.Optimizer.Type="Gradient Optimization"

 Sub Main
     For i = 1 To Project.Optimizer.TypeCount
          Debug.Print Project.Optimizer.TypeName(i)
     Next i
End Sub
The output of this will be in the debug window

 Pointer - Robust Optimization
Pointer - Train an Optimizer
Pointer - Run Trained Optimizer
Pointer - Gradient Optimization
Random (Local)
Gradient Optimization
Conjugate Gradient
Simplex Optimizer
Genetic (Uniform Mutation)
Genetic (Gaussian Mutation)
Simulated Annealing (Simplex)
Simulated Annealing (Local)
Random (Global)
Direction Set Method

* Alternately, you can write a function to call the optimizer by name and have it return the index if the name is matched, an example is shown below.

Project.Optimizer.Type=find_opt_type("Simplex Optimizer")
Function find_opt_type(nm As String) As Integer
     Dim typ As Integer

     typ = -1
     For i = 1 To Project.Optimizer.TypeCount
          If nm = Project.Optimizer.TypeName(i) Then
               typ = i
          End If
     Next i
     If typ = -1 Then
          MsgBox ("could not find optimizer name specified:" & nm)
     End If
     find_opt_type = typ
End Function

Setting Optimizer Iterations


Running the Optimizer

  While Project.Optimizer.Running=True