Difference between revisions of "OptEngineInfo"

 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Optimization Functions]]
 
[[Category:Optimization Functions]]
  
''New to [[Analytica 4.3]].  Supercedes the earlier [[SolverInfo]] function.''
+
== OptEngineInfo(engine, item'', asRef'') ==
 
+
The [[OptEngineInfo]] function provides information about a specific optimizer engine, or about the solver engines that are currently installed and ready for use.
= OptEngineInfo(engine,item'',asRef'') =
 
 
 
The SolverInfo function provides information about a specific optimizer engine, or about the solver engines that are currently installed and ready for use.
 
  
 
«Engine» is the name of a solver engine.  The following are included with Analytica:
 
«Engine» is the name of a solver engine.  The following are included with Analytica:
Line 25: Line 22:
 
«Item» may be from this table:
 
«Item» may be from this table:
  
{| border="1"
+
:{| class="wikitable"
! Item !! Dimensionality !! Type !! Description
+
! «Item» !! Dimensionality !! Type !! Description
 
|-
 
|-
| "SettingNames" || List || numeric || Array of control setting names.
+
! <code>"SettingNames"</code>
 +
| List || numeric || Array of control setting names.
 
|-
 
|-
| "MaxSetting" || Local .Parameter || numeric || upper bounds for setting
+
! <code>"MaxSetting"</code>
 +
| Local .Parameter || numeric || upper bounds for setting
 
|-
 
|-
| "MinSetting" || Local .Parameter || numeric || lower bounds for setting
+
! <code>"MinSetting"</code>
 +
| Local .Parameter || numeric || lower bounds for setting
 
|-
 
|-
| "Default" || Local .Parameter || numeric || default value for setting
+
!<code>"Default"</code>
 +
| Local .Parameter || numeric || default value for setting
 
|-
 
|-
| "EngineName" || atomic || text || The engine name (null without error if engine not installed)
+
!<code>"EngineName"</code><br/>or <code>"Name"</code>
 +
| atomic || text || The engine name (null without error if engine not installed)
 
|-
 
|-
| "DLL" || atomic || text || File path to solver engine's DLL, "" for bulit-in engines.
+
! <code>"DLL"</code>
 +
| atomic || text || File path to solver engine's DLL, "" for bulit-in engines.
 
|-
 
|-
| "TrialPeriod" || atomic || numeric || number of days until Frontline solver trial license expires
+
! <code>"TrialPeriod"</code>
 +
| atomic || numeric || number of days until Frontline solver trial license expires
 
|-
 
|-
| "ProblemTypes" || Local .ProblemType || boolean || A list of the problem types handled by each engine
+
! <code>"ProblemTypes"</code>
 +
| Local .ProblemType || boolean || A list of the problem types handled by each engine
 
|-
 
|-
| "MaxVars" || Local .ProblemType || numeric || Maximum number of decision variables supported by engine
+
! <code>"MaxVars"</code>
 +
| Local .ProblemType || numeric || Maximum number of decision variables supported by engine
 
|-
 
|-
| "MaxIntVars" || Local .ProblemType || numeric || Maximum number of integer variables supported by engine
+
! <code>"MaxIntVars"</code>
 +
| Local .ProblemType || numeric || Maximum number of integer variables supported by engine
 
|-
 
|-
| "MaxConstraints" || Local .ProblemType || numeric || Maximum number of constraints supported by engine
+
! <code>"MaxConstraints"</code>
 +
| Local .ProblemType || numeric || Maximum number of constraints supported by engine
 
|-
 
|-
| "MaxVarBounds" || Local .ProblemType || numeric || Maximum number of variable bounds supported by engine
+
! <code>"MaxVarBounds"</code>
 +
| Local .ProblemType || numeric || Maximum number of variable bounds supported by engine
 
|-
 
|-
| "Milliseconds" || atomic || numeric || Time spent in computation.
+
! <code>"Milliseconds"</code>
 +
| atomic || numeric || Time spent in computation.
 
|-
 
|-
| "Iterations" || atomic || numeric || # of iterations engine has performed
+
! <code>"Iterations"</code>
 +
| atomic || numeric || # of iterations engine has performed
 
|-
 
|-
| "Calls" || atomic || numeric || # of function evaluations that have occurred
+
! <code>"Calls"</code>
 +
| atomic || numeric || # of function evaluations that have occurred
 
|-
 
|-
| "Jacobians" || atomic || numeric || # of jacobians evaluations that have occurred
+
! <code>"Jacobians"</code>
 +
| atomic || numeric || # of jacobians evaluations that have occurred
 
|-
 
|-
| "Hessians" || atomic || numeric || # of hessians evaluations that have occurred
+
! <code>"Hessians"</code>
 +
| atomic || numeric || # of hessians evaluations that have occurred
 
|}
 
|}
  
= All Available Engines =
+
== All Available Engines ==
 
 
 
The special usage:
 
The special usage:
[[OptEngineInfo]]("All","")
+
:<code>OptEngineInfo("All", "")</code>
  
 
returns an unindexed list of all solver engine names present on the computer.   
 
returns an unindexed list of all solver engine names present on the computer.   
  
When you use "All" with an item specified, then that item information is returned for all engines.  The result is indexed by a local index named '''.Engine'''.  For example, to get the DLL location for all add-on engines, use:
+
When you use "All" with an item specified, then that item information is returned for all engines.  The result is indexed by a local index named <code>.Engine</code>.  For example, to get the DLL location for all add-on engines, use:
 
 
[[OptEngineInfo]]("All","DLL")
 
  
note: for the four standard built-in engines, the DLL evaluates to the empty text value, "".  For add-on engines, this a non-empty file path.  For mal-configured add-on engines, [[«null»]] is returned.
+
:<code>OptEngineInfo("All", "DLL")</code>
  
= Getting the result as a Reference =
+
note: for the four standard built-in engines, the DLL evaluates to the empty text value, "".  For add-on engines, this a non-empty file path.  For mal-configured add-on engines, [[Null]] is returned.
  
When the optional parameter, «asRef», is specified as <code>True</code> a [[reference]] to the requested value is returned.  This is useful when you are requesting multiple items with different dimensionalities at the same time, or when requesting one of the items indexed by '''.Parameter''' for multiple engines at the same time.  If you don't use <code>asRef:true</code> in these cases, the dimensions will be combined, which may not be desired.
+
== Getting the result as a Reference ==
 +
When the optional parameter, «asRef», is specified as <code>True</code> a [[reference]] to the requested value is returned.  This is useful when you are requesting multiple items with different dimensionalities at the same time, or when requesting one of the items indexed by '''.Parameter''' for multiple engines at the same time.  If you don't use <code>asRef: True</code> in these cases, the dimensions will be combined, which may not be desired.
  
 
To illustrate, consider an example:
 
To illustrate, consider an example:
[[OptEngineInfo]]("LP/Quadratic",["MaxSetting","MaxVars"])
+
:<code>OptEngineInfo("LP/Quadratic", ["MaxSetting", "MaxVars"])</code>
  
Notice that <code>[[OptEngineInfo]]("LP/Quadratic","MaxSetting")</code> is indexed by '''.Parameter''', while <code>[[OptEngineInfo]]("LP/Quadratic","MaxVars")</code> is indexed by '''.ProblemType'''.  The result of the above expression will thus be a 3-D array indexed by both '''.Parameter''' and '''.ProblemType''', as well as by the implicit index ["MaxSetting","MaxVars"].  When you examine just the "MaxSetting" slice, there is an extra index '''.ProblemType''' that has nothing to do with the "MaxSetting".
+
Notice that <code>OptEngineInfo("LP/Quadratic","MaxSetting")</code> is indexed by <code>.Parameter</code>, while <code>OptEngineInfo("LP/Quadratic","MaxVars")</code> is indexed by <code>.ProblemType</code>.  The result of the above expression will thus be a 3-D array indexed by both <code>.Parameter</code>and <code>.ProblemType</code>, as well as by the implicit index <code>["MaxSetting", "MaxVars"]</code>.  When you examine just the <code>MaxSetting</code> [[slice]], there is an extra index <code>.ProblemType</code> that has nothing to do with the <code>MaxSetting</code>.
  
 
The use of [[references]] avoids this undesired combination of dimensions.  When the above is replaced by:
 
The use of [[references]] avoids this undesired combination of dimensions.  When the above is replaced by:
[[OptEngineInfo]]("LP/Quadratic",["MaxSetting","MaxVars"],asRef:true)
+
:<code>OptEngineInfo("LP/Quadratic", ["MaxSetting", "MaxVars"], asRef: true)</code>
  
then the result is a two cell vector, the first item being a [[reference]] to a 1-D array indexed by '''.Parameter''', the second item being a [[reference]] to a 1-D array indexed by '''.ProblemType'''.
+
then the result is a two cell vector, the first item being a [[reference]] to a 1-D array indexed by <code>.Parameter</code>, the second item being a [[reference]] to a 1-D array indexed by <code>.ProblemType</code>.
  
 
It is recommended that you use references when obtaining the parameter settings for multiple engines, since it is possible for different engines to have a different set of parameters.  When the parameter sets are identical for all engines, then the same index will be used.  But this is not guaranteed as some parameters are unique to specific engines, and in that case you could end up with multiple '''.Parameter''' indexes in the same array.  Hence, you should use, e.g.:
 
It is recommended that you use references when obtaining the parameter settings for multiple engines, since it is possible for different engines to have a different set of parameters.  When the parameter sets are identical for all engines, then the same index will be used.  But this is not guaranteed as some parameters are unique to specific engines, and in that case you could end up with multiple '''.Parameter''' indexes in the same array.  Hence, you should use, e.g.:
  
[[OptEngineInfo]]("All","Defaults",asRef:true)
+
:<code>OptEngineInfo("All", "Defaults", asRef: True)</code>
  
 +
== Examples ==
 +
:<code>OptEngineInfo("All", "ProblemTypes") &rarr;</code>
  
= Examples =
+
:[[image:ProblemTypesByEng.png]]
  
:[[OptEngineInfo]]("All","ProblemTypes") &rarr; [[image:ProblemTypesByEng.png]]
+
:<code>OptEngineInfo("Evolutionary", ["MaxSetting", "Default", "MinSetting"]) &rarr; </code>
  
:[[OptEngineInfo]]("Evolutionary",["MaxSetting","Default","MinSetting"]) &rarr; [[image:EvolutionarySettings.png]]
+
:[[image:EvolutionarySettings.png]]
  
= See Also =
+
==See Also==
 +
This function was introduced in  [[Analytica 4.3]] and supersedes the earlier [[SolverInfo]] function.
  
 +
== See Also ==
 
* [[OptInfo]]
 
* [[OptInfo]]
 +
* [[DefineOptimization]]
 
* [[Using a Solver Add-on Engine]]
 
* [[Using a Solver Add-on Engine]]
 +
* [http://www.solver.com/ Frontline add-on solver engines]
 +
* [[SolverInfo]]

Latest revision as of 21:05, 29 March 2016


OptEngineInfo(engine, item, asRef)

The OptEngineInfo function provides information about a specific optimizer engine, or about the solver engines that are currently installed and ready for use.

«Engine» is the name of a solver engine. The following are included with Analytica:

  • "Lp/Quadratic"
  • "SOCP Barrier"
  • "GRG Nonlinear"
  • "Evolutionary"

Various add-on engines can be purchased separately. These include:

  • "LSLP"
  • "LSGRG"
  • "LSSQP"
  • "Knitro"
  • "OptQuest"
  • "MOSEK"
  • "XPress"
  • "Gurobi"

«Item» may be from this table:

«Item» Dimensionality Type Description
"SettingNames" List numeric Array of control setting names.
"MaxSetting" Local .Parameter numeric upper bounds for setting
"MinSetting" Local .Parameter numeric lower bounds for setting
"Default" Local .Parameter numeric default value for setting
"EngineName"
or "Name"
atomic text The engine name (null without error if engine not installed)
"DLL" atomic text File path to solver engine's DLL, "" for bulit-in engines.
"TrialPeriod" atomic numeric number of days until Frontline solver trial license expires
"ProblemTypes" Local .ProblemType boolean A list of the problem types handled by each engine
"MaxVars" Local .ProblemType numeric Maximum number of decision variables supported by engine
"MaxIntVars" Local .ProblemType numeric Maximum number of integer variables supported by engine
"MaxConstraints" Local .ProblemType numeric Maximum number of constraints supported by engine
"MaxVarBounds" Local .ProblemType numeric Maximum number of variable bounds supported by engine
"Milliseconds" atomic numeric Time spent in computation.
"Iterations" atomic numeric # of iterations engine has performed
"Calls" atomic numeric # of function evaluations that have occurred
"Jacobians" atomic numeric # of jacobians evaluations that have occurred
"Hessians" atomic numeric # of hessians evaluations that have occurred

All Available Engines

The special usage:

OptEngineInfo("All", "")

returns an unindexed list of all solver engine names present on the computer.

When you use "All" with an item specified, then that item information is returned for all engines. The result is indexed by a local index named .Engine. For example, to get the DLL location for all add-on engines, use:

OptEngineInfo("All", "DLL")

note: for the four standard built-in engines, the DLL evaluates to the empty text value, "". For add-on engines, this a non-empty file path. For mal-configured add-on engines, Null is returned.

Getting the result as a Reference

When the optional parameter, «asRef», is specified as True a reference to the requested value is returned. This is useful when you are requesting multiple items with different dimensionalities at the same time, or when requesting one of the items indexed by .Parameter for multiple engines at the same time. If you don't use asRef: True in these cases, the dimensions will be combined, which may not be desired.

To illustrate, consider an example:

OptEngineInfo("LP/Quadratic", ["MaxSetting", "MaxVars"])

Notice that OptEngineInfo("LP/Quadratic","MaxSetting") is indexed by .Parameter, while OptEngineInfo("LP/Quadratic","MaxVars") is indexed by .ProblemType. The result of the above expression will thus be a 3-D array indexed by both .Parameterand .ProblemType, as well as by the implicit index ["MaxSetting", "MaxVars"]. When you examine just the MaxSetting slice, there is an extra index .ProblemType that has nothing to do with the MaxSetting.

The use of references avoids this undesired combination of dimensions. When the above is replaced by:

OptEngineInfo("LP/Quadratic", ["MaxSetting", "MaxVars"], asRef: true)

then the result is a two cell vector, the first item being a reference to a 1-D array indexed by .Parameter, the second item being a reference to a 1-D array indexed by .ProblemType.

It is recommended that you use references when obtaining the parameter settings for multiple engines, since it is possible for different engines to have a different set of parameters. When the parameter sets are identical for all engines, then the same index will be used. But this is not guaranteed as some parameters are unique to specific engines, and in that case you could end up with multiple .Parameter indexes in the same array. Hence, you should use, e.g.:

OptEngineInfo("All", "Defaults", asRef: True)

Examples

OptEngineInfo("All", "ProblemTypes") →
ProblemTypesByEng.png
OptEngineInfo("Evolutionary", ["MaxSetting", "Default", "MinSetting"]) →
EvolutionarySettings.png

See Also

This function was introduced in Analytica 4.3 and supersedes the earlier SolverInfo function.

See Also

Comments


You are not allowed to post comments.