Modify multidimensional parameter with Python GamsModelInstance

Questions on using the GAMS APIs (Python, .NET, etc.)
Post Reply
ClayCampaigne
User
User
Posts: 1
Joined: 6 years ago

Modify multidimensional parameter with Python GamsModelInstance

Post 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
User avatar
Clemens
Posts: 57
Joined: 7 years ago

Re: Modify multidimensional parameter with Python GamsModelInstance

Post 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
Post Reply