Search found 11 matches

by Freddy
2 months ago
Forum: Archive Google Group
Topic: Error 170
Replies: 1
Views: 502

Re: Error 170

warkcrm, the first dimension in a GAMS table is the row dimension. You need to swap the indices for the parameter T (or transpose the table) as so: Sets i "Plantas" /Armenia,Pereira,Manizales / j "Zonas" /1,2,3,4,5/; Table T (j,i) "Costo de transportar de la planta i a la zona j" Armenia Pereira Man...
by Freddy
3 months ago
Forum: Tools
Topic: Encoding problem with cyrillic letters in a gdx-file
Replies: 3
Views: 336

Re: Encoding problem with cyrillic letters in a gdx-file

akos, How are you viewing your gdx file? Gdx does not know anything about encoding. This means it stores explanatory text with the same enconding as the .gms file with your „execute_unload“ command. GAMS Studio provides a way to reload the current file with a different encoding via „Edit“->“Reload w...
by Freddy
3 months ago
Forum: Tools
Topic: gdxrrw Mac OS
Replies: 2
Views: 315

Re: gdxrrw Mac OS

Hello. The problem is that the gdx library is not in the path you specified. Instead, use:

Code: Select all

igdx("/Applications/GAMS30.3/Resources/sysdir")
by Freddy
8 months ago
Forum: Modeling
Topic: how to get any element from a two dimensional set
Replies: 4
Views: 599

Re: how to get any element from a two dimensional set

How about this?

Code: Select all

Set i /1*3/;  
set j /1*3/;  
Set a(i,j) /1.2,2.3,1.3/;
set b(i,j);
b(i,j)$(ord(i) = 3 and ord(j) = 1) = yes;
by Freddy
1 year ago
Forum: GAMS MIRO
Topic: Is it possible to pass on miro input to a $call command?
Replies: 2
Views: 1540

Re: Is it possible to pass on miro input to a $call command?

Hello, Jason, MIRO currently assigns values to GAMS parameters at the end of the compilation phase (right before the start of the execution phase). Therefore, Input is always 1 at the time your expression is evaluated. Admittedly, this behavior is not entirely intuitive and will most likely change b...
by Freddy
1 year ago
Forum: Tools
Topic: Export report summary to GDX
Replies: 2
Views: 948

Re: Export report summary to GDX

Hi,

if I understand you correctly, what you are looking for are the model attributes solvestat and modelstat. Use these in combination with the GAMS programming flow control features and you can write your own custom logic when and what to export.

Best,
Freddy
by Freddy
1 year ago
Forum: Modeling
Topic: Production Batch Constraint
Replies: 3
Views: 2700

Re: Production Batch Constraint

Sure, let's take the following equation: vincolo(forn) .. sum(pp, k(pp,forn)) =l= numeropp(forn); and add a non-negative slack variable slack(forn) to this equation as follows: vincolo(forn) .. sum(pp, k(pp,forn)) =l= numeropp(forn) + slack(forn); Subtract the slack variables (potentially multiplied...
by Freddy
1 year ago
Forum: Modeling
Topic: Production Batch Constraint
Replies: 3
Views: 2700

Re: Production Batch Constraint

Hello Leonardo, if the solver reports "integer infeasible" then there is no feasible solution for the data you have provided. However, the model being infeasible does not mean the problem you want to solve is infeasible. You might have just modelled the reality too restrictive. One way to avoid havi...
by Freddy
1 year ago
Forum: API
Topic: Python Embedded in Gams - Import Python Package
Replies: 13
Views: 4824

Re: Python Embedded in Gams - Import Python Package

Yes you can. Either install the package manually by navigating to your GMSPython folder (i.e. <GAMSRoot>/GMSPython) and using the pip executable (python package management system). This tool should be located in a folder "Scripts" or something similar. (you can install pandas with pip with the comma...
by Freddy
2 years ago
Forum: Syntax
Topic: Define dynamic set using embedded code facility
Replies: 4
Views: 1051

Re: Define dynamic set using embedded code facility

So the problem here is that you are using the ord operator on the dynamic set 'sub_t'. Please refer to: https://www.gams.com/latest/docs/UG_OrderedSets.html#UG_OrderedSets_OrdAndCard for more information about how to use the ord operator. I have changed your code, so it executes properly now. If thi...