ampl_option
Fetch or update an AMPL option's value. Prevents silent failures by raising an error if the option name is not recognized, ensuring typos do not create unintended options.
Instructions
Get an AMPL option, or set it when value is given.
An option name AMPL does not have is an argument_error, on both the
get and the set: AMPL creates an option on first assignment, so a typo
like ampl_option("solvre", "cbc") would otherwise report success while
creating an inert option and leaving the real solver untouched. The
one exception is the <solver>_options directive convention
(highs_options, gurobi_options, ...), which by design does not exist
until you create it.
value must be a string when given.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| value | No | ||
| session | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||