Access strings in Sets
Posted: Tue Apr 12, 2016 4:29 pm
Hi folks,
GAMS offers the possibility to read Sets from e.g. an Excel file using the Values=String option. Then instead of just having Y or N as data for each element, whatever string is in the column is read into GAMS as value. Now my question is: is there any way to actually access the strings read in that way? I would imagine a suffix such as ".text" or similar to do that.
Say you have:
Sets
a /a0*a5/
b(a)
;
Then the set b(a) can usually have values such as:
b("a0") = Y
b("a1") = Y
b("a2") = N
But using gdxxrw you have the option to read in whatever string you have instead of the Y / N. So the resulting GDX would have values such as:
b("a0") = some
b("a1") = random
b("a2") = string
In itself this is not very useful (it just looks ugly and the string has no meaning in itself), but I would like to "misuse" that feature for my data upload, where I need to do things with strings (which are categorical values). However, there seems no way of actually accessing that string. Whenever I try to access it, I just get 1 as the output.
cheers
Ingmar
--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.