Page 1 of 1

Modify multidimensional parameter with Python GamsModelInstance

Posted: Sun Sep 03, 2017 11:18 pm
by ClayCampaigne
Are there any examples of how to modify multidimensional parameters with a GamsModifier? I can't find any examples in the API tutorial, examples, documentation, or elsewhere.

Thanks
Clay

Re: Modify multidimensional parameter with Python GamsModelInstance

Posted: Mon Sep 04, 2017 10:03 am
by Clemens
Please have a look at the transport7.py example: https://www.gams.com/latest/docs/apis/e ... ource.html
Although it doesn't show how to modify a two dimensional parameter, it shows both the use of a scalar parameter and a two dimensional variable. Instead of adding a scalar parameter to the sync_db, you can just add a parameter with arbitrary dimension. On line 107/108 you can see how to clear and add new records to a multi dimensional parameter.

Best,
Clemens