defining a subset

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

defining a subset

Post by Archiver »


Dear All

I have a number of node from n=1 to n=296 out of which the first 90 must be flagged as zones in a subset called "Dest"
below is part of the code,
theere is an error at the last command and i cant figure it out.
Any idea is highly appreciated,

Thanks Saeed

SET n node /1*296/;
ALIAS (z,n)
SET Dest(z) zones;

.
.
.

Dest(z)$(z le 90)=yes;

--
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.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

RE: defining a subset

Post by Archiver »


Hi Saeed



All set elements are treated as characters, not as numbers, so you have to use the function ord, e.g.

Dest(z)$(ord(z) le 90) = YES;



Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Saeed Asadi
Sent: Freitag, 4. März 2016 06:03
To: gamsworld
Subject: defining a subset



Dear All



I have a number of node from n=1 to n=296 out of which the first 90 must be flagged as zones in a subset called "Dest"

below is part of the code,

theere is an error at the last command and i cant figure it out.

Any idea is highly appreciated,



Thanks Saeed



SET n node /1*296/;

ALIAS (z,n)

SET Dest(z) zones;



.

.

.



Dest(z)$(z le 90)=yes;

--
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.

--
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.
Post Reply