Difference between revisions of "Using Named Parameters"
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category: Analytica Optimizer Guide]] | [[Category: Analytica Optimizer Guide]] | ||
+ | [[Category: Functions]] | ||
− | <breadcrumbs> Analytica Optimizer Guide > Optimizer | + | <breadcrumbs> Analytica Optimizer Guide > Optimizer Functions > {{PAGENAME}}</breadcrumbs> |
− | When calling a function in Analytica, you can use the conventional method of listing parameters in their standard sequence, or named-parameter syntax, where you type the parameter name | + | When calling a function in Analytica, you can use the conventional method of listing parameters in their standard sequence, or named-parameter syntax, where you type the parameter name in any order, followed by a colon (:), followed by the parameter value. Here is an example: |
:<code>DefineOptimization(</code> | :<code>DefineOptimization(</code> | ||
Line 12: | Line 13: | ||
If a function, such as [[DefineOptimization]](), has a large number of optional parameters, named-parameters are much more convenient to write and read. So, we use that method in our examples. | If a function, such as [[DefineOptimization]](), has a large number of optional parameters, named-parameters are much more convenient to write and read. So, we use that method in our examples. | ||
− | You can view the full parameter declarations from Analytica, in the actual parameter order, by selecting | + | You can view the full parameter declarations from Analytica, in the actual parameter order, by selecting [[Definition menu|Definition]] > '''Optimizer''' > '''''<function>''''' from the Analytica menu. |
==See Also== | ==See Also== | ||
+ | * [[Function calls and parameters]] | ||
+ | * [[Function parameter qualifiers]] | ||
+ | * [[Objects and Values]] | ||
+ | * [[DefineOptimization]] | ||
* [[:Category: Optimization Functions]] | * [[:Category: Optimization Functions]] | ||
− | <footer> Optimizer | + | |
+ | |||
+ | <footer> Optimizer Functions/ {{PAGENAME}} / Primary Optimization Functions</footer> |
Latest revision as of 17:47, 7 June 2016
When calling a function in Analytica, you can use the conventional method of listing parameters in their standard sequence, or named-parameter syntax, where you type the parameter name in any order, followed by a colon (:), followed by the parameter value. Here is an example:
DefineOptimization(
Decisions: [d1, d2],
Constraints: [c1, c2, c3],
Maximize: x)
If a function, such as DefineOptimization(), has a large number of optional parameters, named-parameters are much more convenient to write and read. So, we use that method in our examples.
You can view the full parameter declarations from Analytica, in the actual parameter order, by selecting Definition > Optimizer > <function> from the Analytica menu.
See Also
- Function calls and parameters
- Function parameter qualifiers
- Objects and Values
- DefineOptimization
- Category: Optimization Functions
Comments
Enable comment auto-refresher