Search found 639 matches

by Renger
3 years ago
Forum: Syntax
Topic: Error Using ParallelMode
Replies: 2
Views: 14604

Re: Error Using ParallelMode

Hi Gams does not recognize the option parallelmode as it is solver specific and should be put in an option file. For example, you could add this to your code $echo parallelmode -1 > cplex.opt $echo threads = 8 >>cplex.opt mymodel.optfile=1; where "mymodel" is your model name. Try this and ...
by Renger
3 years ago
Forum: Tools
Topic: Load zero values to GAMS from GDX File
Replies: 6
Views: 6449

Re: Load zero values to GAMS from GDX File

Hi A zero value is loaded but GAMS assumes zero for a parameter without a value, so it is only a problem in displaying the values. If you want to display zero values in your listing, you can add EPS to all values of a parameter. The display will then show EPS for the zero values (the special value E...
by Renger
3 years ago
Forum: Syntax
Topic: Equations related to different values of a set
Replies: 2
Views: 19601

Re: Equations related to different values of a set

Hi You can write just one equation: set t /1*100/; FI(i,j,t) =E= It0(i,j)$(t.val = 1) + FI(i,j,t-1)$(t.val > 1) .... If your t set has numbers you can use t.val otherwise you should use ord(t). set t /y1*y100/; FI(i,j,t) =E= It0(i,j)$(ord(t) = 1) + FI(i,j,t-1)$(ord(t)l > 1) .... I hope this helps! C...
by Renger
3 years ago
Forum: Modeling
Topic: Object Value NA problem
Replies: 1
Views: 1774

Re: Object Value NA problem

Hi You have an objective where z (a Variable) is equal to another variable (cMax). But neither cMax or z is part of another equation. In general, to solve an optimization problem you need an objective function that contains variables that appear in the constraints. BTW: You better submit the code or...
by Renger
3 years ago
Forum: Tools
Topic: Load zero values to GAMS from GDX File
Replies: 6
Views: 6449

Re: Load zero values to GAMS from GDX File

Hi Qiaomin
Please submit your code and other necessary files as your question contains not enough information to answer it.

Cheers
Renger
by Renger
3 years ago
Forum: Syntax
Topic: Dynamic sets, set/domain assignment/violation problem
Replies: 6
Views: 7295

Re: Transshipment problem, dynamic sets, set/domain assignment/violation problem

Hi
You could use a dollar constraint like this

Code: Select all

suj(i,j)$(not sameas(i,j))
.

If a and b are parameter, you could write this as

Code: Select all

T = max(sum(i, a(i)), sum(j$(j.val > card(m), b(j)));
Cheers
Renger
by Renger
3 years ago
Forum: Syntax
Topic: Problem writing the sets
Replies: 0
Views: 1833

Re: Problem writing the sets

Hi THe trick is to use a mapping (see here in the documentation): sets t macroperiods (t=0...T) s machine state-oriented microperiods (s=0...S) ; sets k /k0*k3/ t /t1*t2/ s /s0*s14/ swith(t,s) /t1.s1*s7, t2.s8*s14/ swithout(t,s) /t1.s1*s6, t2.s8*s13/ ; Equations capacitylimit2(k,t,s), symetrybreakin...
by Renger
3 years ago
Forum: Syntax
Topic: Dynamic sets, set/domain assignment/violation problem
Replies: 6
Views: 7295

Re: Transshipment problem, dynamic sets, set/domain assignment/violation problem

Hi The trick is to define the assigned sets a subset. After that you have to define the variables and equation over the main set and when used referring to them by the subset. I attached your model with these changes (and added a random value for T, but please look for a proper value). Cheers Renger...
by Renger
3 years ago
Forum: Modeling
Topic: A "division by zero" in a line where no calculation happens
Replies: 7
Views: 23005

Re: A "division by zero" in a line where no calculation happens

Hi A good way of testing if you are missing zero values is the following: yh.l(h,t) = yh.l(h,t) + EPS; display yh.l; GAMS doesn't display zeros, so you would easily miss parameters that are zero. Adding EPS (the special value EPS is numerically equal to zero, so when used in the context of numerical...
by Renger
3 years ago
Forum: Modeling
Topic: A "division by zero" in a line where no calculation happens
Replies: 7
Views: 23005

Re: A "division by zero" in a line where no calculation happens

Hi If you want help, you should provide your model in such a way that it runs without any interference from the person who wants to help you. In your case, you should be sure that all files used are included (which is not the case) and the model produces lots of errors because of paths to subdirecto...