ampl_set_data
Assign a parameter from JSON in AMPL models, bypassing hand-written .dat syntax. Set scalar, indexed, or multi-dimensional values directly.
Instructions
Assign a parameter from JSON, avoiding hand-written .dat syntax.
values may be a scalar, a mapping of index to value, or a list of
[index..., value] records for multi-dimensional entities. The parameter
must already be declared. This tool handles parameters only; to declare
or assign a set, use ampl_eval with a statement such as
set S = {1,2,3};.
name must be a bare AMPL entity name; it is interpolated into an AMPL
statement, so anything else is an argument_error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| values | Yes | ||
| session | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||