Search found 570 matches

by bussieck
6 days ago
Forum: Announcements
Topic: GAMS Distribution 35.0.0 (Beta Release)
Replies: 0
Views: 37

GAMS Distribution 35.0.0 (Beta Release)

Hi GAMS Users, We would like to announce the availability of the GAMS Beta Release 35.0.0. Please consult the beta release notes for details about new features and updated solvers: https://www.gams.com/beta/docs/RN_35.html If you are interested in experimenting with this beta release, please downloa...
by bussieck
1 week ago
Forum: Modeling
Topic: Input more 1-D parameters from excel
Replies: 2
Views: 99

Re: Input more 1-D parameters from excel

Don't use xls2gms. It's a tool on its way out. Use gdxxrw :

Code: Select all

set i; parameter f(i<), p(i), d(i), c(i);
$call.checkErrorLevel gdxxrw i=data.xls o=data.gdx par=f rng=a2 rdim=1 par=p rng=c2 rdim=1 par=d rng=e2 rdim=1 par=c rng=g2 rdim=1
$gdxin data
$load f p d c
-Michael
by bussieck
1 week ago
Forum: Modeling
Topic: Looped Distribution Model is very slow
Replies: 2
Views: 78

Re: Looped Distribution Model is very slow

I would turn on profile (see https://www.gams.com/latest/docs/UG_GamsCall.html#GAMSAOprofile) to see if generation of any of the equations is particularly slow. For the increased memory over time: GAMS merges the variables and equations into it's database, so for each slice GAMS has to remember more...
by bussieck
1 week ago
Forum: API
Topic: GamsModifier don't work
Replies: 5
Views: 388

Re: GamsModifier don't work

Again, due to the fast generation and log solution times you should just work with GAMSJob instead of GAMSModelInstance. If you for whatever reason need to work with a GAMSModelInstance you need to reformulate the constraint. Think of a modifier as a fixed variable. Variables can't be used in $() co...
by bussieck
2 weeks ago
Forum: API
Topic: GamsModifier don't work
Replies: 5
Views: 388

Re: GamsModifier don't work

There are many good reasons to work with up-to-date software. You should consider to work with an up-to-date version of GAMS. The GMSPython of GAMS 25 probably did not come with pandas. There can be many different reasons why you get different objective functions (did you set optcr to 0?). I think y...
by bussieck
3 weeks ago
Forum: API
Topic: GamsModifier don't work
Replies: 5
Views: 388

Re: GamsModifier don't work

Hi, I had to adjust your path string not only to match my directory structure but also added the r for raw string (data_dir = r"D:\Users\mbussieck\Downloads\随机生成序列2/"). I could run the Python script okay. I don't know whay goes wrong. before the first solve, the update database contains a single ele...
by bussieck
4 weeks ago
Forum: API
Topic: error 796 in python api
Replies: 1
Views: 172

Re: error 796 in python api

You need to understand how model instances and updaters work. Read the GUSS manual (https://www.gams.com/latest/docs/S_GUSS.html) that is based on the same techniques. You update Par_g. Par_g never shows up up the model generated by GAMS, it is only used in some loop statements to calculate other pa...
by bussieck
1 month ago
Forum: Archive Google Group
Topic: 502 and 510 error
Replies: 6
Views: 2225

Re: 502 and 510 error

It's hard to help without being able to reproduce a problem, but in this case one problem is obvious: The gdxxrw ask for a 3 dimensional parameter (rdim+cdim=2+1=3) while your GAMS parameter has 4 dimensions: f,l,i,t. That can't work.

-Michael
by bussieck
1 month ago
Forum: Syntax
Topic: Question in regards to using $if for $includes
Replies: 2
Views: 784

Re: Question in regards to using $if for $includes

You have to understand the difference between GAMS compile and execution time in order to implement such logic: https://www.gams.com/34/docs/UG_GamsCall.html#UG_GamsCall_TwoPass. The trouble is that you don't have convenient access to values of indexed symbols (like your cfunctions) at compile time....
by bussieck
1 month ago
Forum: API
Topic: Non-ASCII characters in .gdx created with Python API
Replies: 2
Views: 624

Re: Non-ASCII characters in .gdx created with Python API

Your text file is encoded in utf-8 and you look at the GDX file with the IDE which can only do the "system" encoding that shows the utf-8 encoded ã incorrectly. The GDX file is actually fine. For example, if you dump into a text file and look at it with an editor that encodes with utf-8 then things ...