Modify multidimensional parameter with Python GamsModelInstance

Questions on using the GAMS APIs (Python, .NET, etc.)
ClayCampaigne
User
User
Posts: 1
Joined: 3 months ago

Modify multidimensional parameter with Python GamsModelInstance

Postby ClayCampaigne » 3 months ago

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

Clemens
Posts: 10
Joined: 1 year ago

Re: Modify multidimensional parameter with Python GamsModelInstance

Postby Clemens » 3 months ago

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


Who is online

Users browsing this forum: No registered users and 1 guest