I need to subscript set step in a parameter declaration but am getting an error message:
param torv{{sss in cartSR} step[sss]} binary ;
syntax error
context: param torv{{sss in cartSR} >>> step[ <<< sss]} binary ;
Please advise
I need to subscript set step in a parameter declaration but am getting an error message:
param torv{{sss in cartSR} step[sss]} binary ;
syntax error
context: param torv{{sss in cartSR} >>> step[ <<< sss]} binary ;
Please advise
You can write it like this:
set cartSR;
set step {cartSR};
param torv {sss in cartSR, st in step[sss]} binary;
Then in the model, the params are referenced as torv[sss,st]
.
For a detailed presentation of how this works, see section 6.5 Indexed collections of sets in the AMPL book.