Originally posted by: BPVR_khaled_soradi
This is my first program. I am trying to simple exam table scheduling problem. i have subjects that i need to schedule. I have the subject conflict table that contains pairs of subjects that should not scheduled at the same time. the program is working except the part of noOverlap over the conflicts array.
I do not know how to write the "noOverlap" statement.
Here is the program
using CP;
execute{
}
tuple SubjectInfo{
key int id;
string Name;
int duration;
};
tuple ConflictInfo{
int Subj1;
int Subj2;
};
{SubjectInfo} Subjects=...;
{ConflictInfo} SubjectsConflict=...;
dvar interval SubjectAllocation[s in Subjects] size s.duration;
dvar sequence p in SubjectAllocation;
minimize max(s in Subjects) endOf(SubjectAllocation[s]);
subject to {
//The problem is here.
forall (i in SubjectsConflict)
noOverlap(p);
}
execute {
}
And this is the sample data file
//Subjects Data
Subjects={
<1,"ARCN101",1>,
<2,"ARCN102",1>,
<3,"ARCN103",1>,
<4,"ARCN104",1>
};
//Subjects Conflicts. this sample assumes that "ARCN101"
//should not scheduled with any other subject
SubjectsConflict={
<1,2>,
<1,3>,
<1,4>
};
#ConstraintProgramming-General#DecisionOptimization