Search found 1042 matches

by bussieck
3 years ago
Forum: API
Topic: Using Embedded Python through API
Replies: 3
Views: 6269

Re: Using Embedded Python through API

That's not an example. And the statement that GamsModelInstances don't execute any GAMS code including embedded code still holds. -Michael
by bussieck
3 years ago
Forum: API
Topic: Using Embedded Python through API
Replies: 3
Views: 6269

Re: Using Embedded Python through API

I don't understand what you are asking. A modifier is only known in the context of a GamsModelInstance which does not execute any GAMS code it works off a generated model. Perhaps posting a small reproducible example is the way to go.

-Michael
by bussieck
3 years ago
Forum: Modeling
Topic: Clearing the declarations between solving the models.
Replies: 2
Views: 1933

Re: Clearing the declarations between solving the models.

Hi, There is no good way to start from scratch after you compiled a significant piece of code. Your scenarios might be close enough (in terms of domain sets etc) that this can be accomplished with lots of $clear and $onMulti (see https://www.gams.com/latest/docs/UG_DollarControlOptions.html) but it ...
by bussieck
3 years ago
Forum: Syntax
Topic: Change dimension
Replies: 3
Views: 6458

Re: Change dimension

Sure. But you should understand the GAMS code yourself. It you understand what it does the change is trivial: set HUD /HUD02,HUD10,HUD15,HUD20/; set IUD /IUD15,IUD20/; set himap(HUD,IUD) / HUD15.IUD15,HUD20.IUD20 /; parameters test(HUD,IUD) / HUD02 .IUD15 15 HUD10 .IUD15 20 HUD10 .IUD20 30 /; parame...
by bussieck
3 years ago
Forum: Syntax
Topic: Change dimension
Replies: 3
Views: 6458

Re: Change dimension

If there are not so many IUD elements, make a map between the IUD and the corresponding HUD (himap) and use this to create the new parameter: set HUD /HUD02,HUD10,HUD15,HUD20/; set IUD /IUD15,IUD20/; set himap(HUD,IUD) / HUD15.IUD15,HUD20.IUD20 /; parameters test(HUD,IUD) / HUD02 .IUD15 15 HUD10 .IU...
by bussieck
3 years ago
Forum: API
Topic: Problem occurred when trying to load embpycclib
Replies: 1
Views: 3790

Re: Problem occurred when trying to load embpycclib

Can be many things. For example, missing C run-time system. One would need much more information (OS, OS version, GAMS version, ...) I suggest you write to GAMS' support and provide license information.

-Michael
by bussieck
3 years ago
Forum: Modeling
Topic: why can the feasible problem not find solution
Replies: 1
Views: 1604

Re: why can the feasible problem not find solution

Without something to reproduce there is nothing to do. -Michael
by bussieck
3 years ago
Forum: Syntax
Topic: How to loop over sub-folders
Replies: 2
Views: 2128

Re: How to loop over sub-folders

Embedded Python is your friend: $call test -d dir1 || mkdir dir1 $call test -d dir2 || mkdir dir2 $call test -d dir3 || mkdir dir3 $onechoV > listdir.gms display "%1"; $offecho $onEmbeddedCode Python: import os dirs = [ root for root, dirs, files in os.walk(os.path.normpath(r"%gams.wd...
by bussieck
3 years ago
Forum: Solvers
Topic: Save CPU time when running a model for multiple times
Replies: 3
Views: 6427

Re: Save CPU time when running a model for multiple times

If you know all the binary variable fixings ahead of time you can use GUSS: https://www.gams.com/latest/docs/S_GUSS.html. GUSS generates the model once and solves for many different "scenarios". If the outcome of solve n-1 impacts the bound setting of solve n you can't use GUSS. You can us...
by bussieck
3 years ago
Forum: Modeling
Topic: Using solution of one model as upper/lower bound in that model again - Global Optimization
Replies: 1
Views: 1577

Re: Using solution of one model as upper/lower bound in that model again - Global Optimization

Be careful with "helping" an algorithm with bounding scheme (like branch-and-bound) with bounds. For minimization problem only set an upper bound (or even better provide a feasible solution). Never set the the lower bound. (opposite for maximization problems). Setting a "helping"...