Search found 91 matches

by dirkse
1 day ago
Forum: Modeling
Topic: Default output for infeasible problems.
Replies: 1
Views: 47

Re: Default output for infeasible problems.

Laurus, GAMS has a robust data-handling capability for just such a need. Something like this will do it: if {(m.modelStat eq 4), result.L = 9999999; }; But the model status can be many things, even for an infeasible model. There are nice compile-time constants to help keep that straight. https://www...
by dirkse
1 week ago
Forum: Syntax
Topic: Decision variables question
Replies: 1
Views: 403

Re: Decision variables question

Dave, From your description, you are looking at X(s,e,p) as a sort of litmus test - it tells you if a condition is true or not, e.g. if student s is scheduled for event e during period p. I typically (always??) look at things the other way around: X(s,e,p) is my decision to schedule student s is sch...
by dirkse
1 week ago
Forum: Tools
Topic: GDX Table structure
Replies: 2
Views: 425

Re: GDX Table structure

Youngghee, There is no difference in the GDX data. You may want to view the same data in different ways, so the GDX viewer allows you to change the view. It also memorizes your previous choice. If you reset the view (i.e. hit the reset button in the viewer) in case-1, it will look like case-2, i.e. ...
by dirkse
1 week ago
Forum: Modeling
Topic: Calculations post solution
Replies: 1
Views: 123

Re: Calculations post solution

Laurus, In general, it is better to compute post-solution the things that merely depend on or derive from the optimal solution. You can see many examples of this in the model library, including in the qmeanvar model. Also the chapter on data manipulations in the Users Guide is very relevant: https:/...
by dirkse
2 weeks ago
Forum: Modeling
Topic: how to get any element from a two dimensional set
Replies: 4
Views: 182

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

You can compute your ord value yourself with a loop: Set i /1*3/; set j /1*3/; Set a(i,j) /1.2, 2.3, 1.3/; parameter ordOfA(i,j); scalar cnt / 0 /; loop{a(i,j), cnt = cnt + 1; ordOfA(i,j) = cnt; }; display a, ordOfA; Be careful how you use this, though. If you want to do something for the tuples in ...
by dirkse
3 weeks ago
Forum: Modeling
Topic: MPSGE on a Mac: model not reading in a loop structure
Replies: 2
Views: 129

Re: MPSGE on a Mac: model not reading in a loop structure

Hi, I'm not aware of any issues on the Mac when it comes to running GAMS or to GAMS code that uses a loop. With MPSGE you use the filesystem more than with other GAMS runs, so it can be a headache to move from the case-insensitive Windows environment to something case-sensitive (i.e., anything but W...
by dirkse
1 month ago
Forum: Solvers
Topic: How to define the empinfo file dynamically
Replies: 1
Views: 304

Re: How to define the empinfo file dynamically

Hello, I encourage you and anyone else using EMP to browse EMPLIB (the library of EMP models that comes with GAMS) to pick up some useful information and techniques. Especially if you are stuck or thinking "There must be a better way to do this!?!", browsing can be a good source of fresh ideas. In t...
by dirkse
1 month ago
Forum: Modeling
Topic: Objective function with Knitro
Replies: 2
Views: 157

Re: Objective function with Knitro

Hello,

Why do you consider this to be a problem?

-Steve
by dirkse
1 month ago
Forum: Modeling
Topic: Extract 1 from variables {-1, 0, 1}
Replies: 2
Views: 193

Re: Extract 1 from variables {-1, 0, 1}

You could do some thing like this:

binary variables
switchOn 'turning machine on'
switchOff 'turning machine off'
;
equation switchCon;
switchCon .. switchOn + switchOff =L= 1;

With this, you have the option to do nothing or to switch on or switch off, but not switch on and off.

-Steve
by dirkse
1 month ago
Forum: Announcements
Topic: issues running GAMS with MacOS Catalina
Replies: 4
Views: 341

issues running GAMS with MacOS Catalina

Hello, On Monday, 7 Oct, Apple released macOS Catalina (10.15). At the moment, GAMS does not "just run" on this version of macOS. Instead, when you run GAMS, you are notified that "the developer of the executable could not be identified". If you upgrade to MacOS Catalina, you can use the following w...