Hi Brian
If you use a specific set element it should be in “ “ (e.g. a,b,c,â€%d2%â€)
Cheers
Renger
From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Brian
Sent: Donnerstag, 24. Oktober 2013 19:37
To: gamsworld@googlegroups.com
Subject: Re: Percent (%) usage
Hi Renger,
Thank you, this is quite useful.
Would I be able to use this technique to run a loop over a parameter that has a mis-ordered set? Basically, I’d like to read data in the order 1,2,3,…11,12 but the set becomes ordered as 1,10,11,12,2,3,…8,9. Running a loop itself would not work, since the set is out of order. For example, running the following would run whatever was in the loop out of the order I wanted:
SETS a
b
c
d1 /t1 t10 t11 t12 t2 t3 t4 t5 t6 t7 t8 t9/
PARAMETER para1(a,b,c,d1);
PARAMETER e
LOOP (d1,
e = para1(a,b,c,d1) + e;
);
But if instead my loop looked like the following:
$setglobal d2 t1
LOOP (d1,
e = para1(a,b,c,%d2%) + e;
);
The issue is that it throws the error “Domain violation for set”. Basically, is there any way to call an observation within a multi-dimensional parameter within a loop that does not loop over a set defined as part of the parameter in question?
Thanks,
Brian
On Wednesday, October 23, 2013 10:37:52 AM UTC-7, Brian wrote:
Hi all,
Quick question - what does the percent sign mean/enable in code. It seems like it may be some form of a macro, but I’m not quite sure. An example would be in the McCarl GAMS User Guide for “$call”
$call Gdxxrw “%XLS%” @xllink.txt log=xllink.log
- If filtered import, read from GDX
$if %more% == ‘’ $goto unfiltered
$GDXin xllink.gdx
$load %sym%
$GDXin
$goto term
$label unfiltered
$onempty
$if ParType %sym% parameter %sym% /
$if SetType %sym% set %sym% /
$call GDXdump xllink.gdx symb=%sym% noheader > xllink.in
$include xllink.in
-Brian
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.