You can only use the card operator on entire symbols not on slices. For that you need to program using sum:

sets

t /1*15/*

k /12/

b1(k,t) /1.1, 1.2, 2.5, 2.6, 2.7/;

parameters

n1(k) cardinality of b1k;

n1(k) = sum(b1(k,t),1);

display n1;

Hope this helps,

Michael Bussieck - GAMS World Coordinator

On Saturday, December 5, 2015 at 12:12:53 AM UTC-5, Maxi Dembczyk wrote:

Hi everybody ,

I have a Problem with the “card” operator. I try to use the card operator to generate the card of a subset from a set.

In this case n1(1)=2 and n1(2)=3.

Does anybody know how this could work, i am sitting here 8 hours and canË‹t find any texts dealing with this problem.

The part with the Problem:

sets

t /1*15/*

k /12/

b1(k,t) /1.1, 1.2, 2.5, 2.6, 2.7/

;

parameters

b(t) t /1 5,2 5,3 4,4 4,5 4,6 2,7 2,8 5,9 4,10 4,11 4,12 1,13 5,14 5,15 5/

n1(k) cardinality of b1k

;

n1(k) = card(b1(k));

display n1;

Thank you

–

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/d/optout.