Search found 11 matches

by GAMSisGREAT
6 years ago
Forum: Syntax
Topic: How to use multiple cores
Replies: 5
Views: 4725

Re: How to use multiple cores

So just to be sure I should do this: Parameter h(i) 'model handles'; minvar.solveLink = 3; loop(i, * solve mymodel using mcp; * save solution as parameter x If(x>0, loop(j, * solve mymodel_2 using mcp; ); h(i) = mymodel.handle; ); * Collect the results loop(i$handleCollect(h(i)), myresults(i,s) = P....
by GAMSisGREAT
6 years ago
Forum: Syntax
Topic: How to use multiple cores
Replies: 5
Views: 4725

Re: How to use multiple cores

Thanks for the quick reply. The problem is that I have sub-loops in a loop which GAMS only calculates if a previous condition holds true. Something like this: loop(i, * solve mcp model * Solution collected in parameter p If(p>0, loop(k, *solve another model ); ); Thus, I don't know how GAMS splits t...
by GAMSisGREAT
6 years ago
Forum: Syntax
Topic: How to use multiple cores
Replies: 5
Views: 4725

How to use multiple cores

I have an MCP maximization problem that I need to solve for several thousand different levels of a parameter. I do this via writing a loop over this parameter and having the MCP problem solved within the loop. Running this takes something like 15 hours, and because I need to do this for many scenari...
by GAMSisGREAT
6 years ago
Forum: Syntax
Topic: Put file, sets, loops
Replies: 0
Views: 2573

Put file, sets, loops

I am trying to combine the use of put files, sets and loops in a specific way. I have a set, dynamic subsets that make up the power set of the full set, I have loops in loops, and some parameter output. It looks roughly like this, I'll use a three member set as an example: Sets $onempty i /A,B,C/ z(...
by GAMSisGREAT
6 years ago
Forum: Modeling
Topic: Loops over sets and conditions
Replies: 3
Views: 3823

Re: Loop and parameters

Would you have any idea how to write this in GAMS if the order of the items in a set do not matter? My thought was to use two loops together with a circular operator, but I just have no idea how to write this circular operator properly in order to get only the upper triangular matrix of all potentia...
by GAMSisGREAT
6 years ago
Forum: Modeling
Topic: Loop over sets with conditions
Replies: 5
Views: 4805

Re: Loop over sets with conditions

Dear Renger, great, thanks so much i see the issue now. Thanks for the answer to "loop over parameters". Unfortunately the admin put the questions "loop and parameters" and "Loop over sets and conditions" together, which should be two distinct questions. So back to the ...
by GAMSisGREAT
6 years ago
Forum: Modeling
Topic: Loop over sets with conditions
Replies: 5
Views: 4805

Re: Loop over sets with conditions

Thanks for this quick reply. My question may have been not clear enough. The subset itself needs to fulfill additional conditions. If it fulfills these conditions, I add another member of the original set, and then I need to check again if the joint conditions are fulfilled. I keep on adding until e...
by GAMSisGREAT
6 years ago
Forum: Modeling
Topic: Loops over sets and conditions
Replies: 3
Views: 3823

Loop and parameters

I have the following problem. I loop through a set, use this to define a new set and its complement, and inside the loop I call some parameters that depend on these sets. However, I can't make these parameters to exclusively be defined over the sets. Here is an example below. What you see in the las...
by GAMSisGREAT
6 years ago
Forum: Modeling
Topic: Loop over sets with conditions
Replies: 5
Views: 4805

Loops over sets and conditions

Hi everyone, I am working on the following problem but can't get my head around it: I have a set, say Sets i "units" / A, B, C, D, E, F, ... / ; This set may have many units (100+). I now search for the subsets of this set that includes all units which together fulfill certain conditions. ...
by GAMSisGREAT
6 years ago
Forum: Syntax
Topic: Loop over strings
Replies: 2
Views: 3378

Re: Loop over strings

Thank you very much for this quick help!