We work on university scheduling problem. We want to preprocess possible room and discipline. We use the timetabling example in CPLEX as our guide.
In timetabling.mod
int PossibleRoom[d in Discipline, x in Room] =
|| 0 == card({
: (
|| (
We have a set of MediumRoom as rooms that has less than or equal to 65 seats,
StudentDiscipline is {
{int} NbStudent = {n |
Then, we try to mimic the code of timetabling.mod as follows
————————————————————————————–
int PossibleLargeRoom[d in Discipline, x in LargeRoom] =
—————————————————————————————-
However something is wrong, we don’t know it because of the syntex or some logic that we stated.
Please help. Thank you very much.
Here is my t.mod
tuple StudentinDiscipline {
string discipline;
int NbStudent;
};
tuple Pair {
string a;
string b;
};
tuple td {
string teacher;
string discipline;
};
{string} LabRoom = …; // the set of available laboratory
{string} SmallRoom = …; // the set of available room for no more than 25 students
{string} MediumRoom = …; // the set of available room for no more than 65 students
{string} LargeRoom = …;
{StudentinDiscipline} StudentDiscipline =…;
{td} TeacherDisciplineSet = …;
{Pair} DedicatedRoomSet = …;
{string} Discipline = {d |
{string} Room = LabRoom union SmallRoom union MediumRoom union LargeRoom;
{int} NbStudent = {n |
/*
int PossibleRoom[d in Discipline, x in Room] =
0 == card({
|| (
*/
int PossibleLargeRoom[d in Discipline, x in LargeRoom] =
/*We want the code to provide the matching discipline that has n students and room that suitable for # students, n<= 300 , but got error 'Expecting a tuple type, found string */
execute {
writeln(“PossibleLargeRoom = “, PossibleLargeRoom);
}
Source: How to preprocess part of information of excel in CP