Doesn't gams process SET data such like time format?

Dear, members

I made table with two indices which are p, t.

I program like below.

sets
P each pilot /a, b, c, d, e, f, g/
T time with 5 minute increments /10:00, 10:05, 10:10, 10:15, 10:20/

table
time(p,t) table value 1 if P is available for T time, otherwise 0

…omited…

When I run gams, it doesn’t recognize set T which consist of 10:00, 10:05, 10:10, 10:15, 10:20.

Doesn’t gams process SET data such like time format??

please let me know how to midify this happening…


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.

Hi Youngki

The “:” is used for writing set elements in sequence format: 1:4 → 1,2,3,4.

Just rename 10:00 etc in 1000, and all works fine.

Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of YOUNGKI CHOI
Sent: Donnerstag, 23. Januar 2014 09:18
To: gamsworld@googlegroups.com
Subject: Doesn’t gams process SET data such like time format?



Dear, members

I made table with two indices which are p, t.

I program like below.

sets
P each pilot /a, b, c, d, e, f, g/
T time with 5 minute increments /10:00, 10:05, 10:10, 10:15, 10:20/

table
time(p,t) table value 1 if P is available for T time, otherwise 0

…omited…

When I run gams, it doesn’t recognize set T which consist of 10:00, 10:05, 10:10, 10:15, 10:20.

Doesn’t gams process SET data such like time format??

please let me know how to midify this happening…


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.

Youngki, Renger,

The colon character “:” is the matching operator in gams, not a sequence. To get a sequence, use the ‘'. Note that the matching operator is fairly new, but of course many things are new when compared to the '’ for a sequence.

Many characters can be used in GAMS labels, but only when quoted. The colon is one such. If you really want to use colons, quote the labels and you will be OK. Or do as Renger suggests and lose the colon.

Run the code below to see what goes on with the different ways to declare a set:

gams time.gms gdx=time
gdxdump time

  • time.gms starts here
    set t0 / 10*00 /;
    set t1 / 10:00, 10:05, 10:10 /;
    set t2 / ‘10:00’, ‘10:05’, ‘10:10’ /;

-Steve


On Thu, Jan 23, 2014 at 3:27 AM, Renger van Nieuwkoop wrote:

Hi Youngki

The “:” is used for writing set elements in sequence format: 1:4 → 1,2,3,4.

Just rename 10:00 etc in 1000, and all works fine.

Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of YOUNGKI CHOI
Sent: Donnerstag, 23. Januar 2014 09:18
To: gamsworld@googlegroups.com
Subject: Doesn’t gams process SET data such like time format?



Dear, members

I made table with two indices which are p, t.

I program like below.

sets
P each pilot /a, b, c, d, e, f, g/
T time with 5 minute increments /10:00, 10:05, 10:10, 10:15, 10:20/

table
time(p,t) table value 1 if P is available for T time, otherwise 0

…omited…

When I run gams, it doesn’t recognize set T which consist of 10:00, 10:05, 10:10, 10:15, 10:20.

Doesn’t gams process SET data such like time format??

please let me know how to midify this happening…


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.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com

Thanks a lot for your help!! Renger!!

I will try learning point.


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.

Thanks a lot for help!! Steven!!


I will follow what you do.!


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.