Then I would like to make a subset of fields which are organic 'organic(M)' and
one which is conventionel 'conventionel(M)' I need to have them as (M)
and not as (I,M). But I can't make it work.
Sets
organic(M)
conventionel(M) ;
organic(M) = ?
conventionel(M) = ?
Keep getting errors like; 'dimension different', 'Uncontrolled set entered as constant' etc .
:-/ Baden
Yes its always a puzzle... Basically you could see a set as a parameter that only takes the values 1 and 0. Then you just need the right summation and multiplication... DId you want the following:
Sets
I "farmers" /1*5/
M "fields" /1*20/
conventional(I) /1,2,4/
organic(I) /3,5/
Ifield(I,M) "farmer I is owner of field(s)"
/1.(1,2)
2.(3,4,6,7,8,9)
3.(10)
4.(11,12,13,14,15,16,17)
5.(18,19,20) /
Sets
organicfields(M)
conventionelfields(M) ;
OrganicFields(M) $sum(I,Ifield(I,M)*organic(I)) =yes;
ConventionelFields(M)$sum(I,Ifield(I,M)*conventional(I))=yes;
display organic,conventional;
display OrganicFields,ConventionelFields;
*Note Field 5 is missing!
Best wishes
Wietse
________________________________________
From: gams...@googlegroups.com [gams...@googlegroups.com] On Behalf Of Baden [jeppe...@gmail.com]
Sent: Thursday, February 09, 2012 3:50 PM
To: gams...@googlegroups.com
Subject: Subset from a one-to-many set
Sets
organic(M)
conventionel(M) ;
:-/ Baden
--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/wJKO3_ItHlQJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
That works just they way that I need. And I also learned a lot. So big thanks!
And yes, typo with the field 5
best regards
baden