set info, dimen 3;
set Students = setof{(c,s,b) in info)} s;
set Classes = setof{(c,s,b) in info)} c;
param HistoricalInfo {c in Classes, s in Students}, binary = setof{(c,s,b) in info)} b;
But do you really need the students that are not assigned to a class? Otherwise the information could be provided in a two dimensional set with student class assignment.
Best regards
Heinrich Schuchardt
http://www.xypron.de
Timothy Calderwood <[email protected]> schrieb:
I have a list of students defined as a set. I have also a param defined for historical information that contains the set of students. As seen below..._______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
set Students;
param HistoricalInfo {c in Classes, s in Students}, binary;
Our project might have any number of students, from 50 to over a 1000. I rather not have to list the students twice, once in the set of students, a second time in param Historical Info.
set Students := David, Jerry, Fannie, Student4, Student5, Student6, Student7, Student8;My question is, is there a way to define set Students from the param data so the students only need to be listed once?
param HistoricalInfo (tr):
English Math Science SocialStudies Elective :=
Jerry 1 0 0 0 0
David 1 0 1 0 0
Fannie 0 1 0 1 0
Student4 1 1 0 1 0
Student5 0 1 0 1 0
Student6 0 1 1 0 1
Student7 1 1 0 0 1
Student8 0 0 0 0 1;
Thanks for you time and help...
_______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
