UniTime / cpsolver

Local-search based solver of Constraint Satisfaction and Optimization Problems
http://www.cpsolver.org
GNU Lesser General Public License v3.0
60 stars 35 forks source link

Is there any constraint about week. #6

Closed DaemonSu closed 6 years ago

DaemonSu commented 6 years ago

hi there! I wonder if there is a class and it has a course from the first week to the third week and it also has other course from the five week to the nine week.Can CPsolver can solver this problem and how to solve.

tomas-muller commented 6 years ago

Yes. This is modeled by date patterns. A date pattern is a binary string (part of a TimeLocation) defining on what days during the term the class can be taught. Two classes overlap in time when their times (time slots during a day) overlap, their days (of the week) overlap and their date patterns overlap.

DaemonSu commented 6 years ago

Thanks a lot. I think I didn't make myself clear. I mean that the same class has three courses A ,B and C. Course A can be taught from the first week to the thrid ,and the course B can be taught from the fifth week to the ninth week and the course C can be taught from the first week to the ninth week. I check the date patterns and it seems that it describe on what days during the term the class can be taught but it can not describe what days during the term the class can be taught Course A and what days during the term the class can be taught Course B

tomas-muller commented 6 years ago

We use a different terminology. There is one course which consists of one or more classes (or lectures). Each lecture represents one set of repetitive meetings, containing a time placement (start time, length, days of the week and a date pattern) and a room placement (a class can meet in no, one, or more rooms). Each such class can have a different time pattern.

This can be modeled easily in UniTime where we have a very general course model. The CPSolver is using this model, but the information is propagated to class level (to the lectures which the solver needs to place in time and space) which could make it a little harder to understand.

For instance, a student taking a course must take a class of each scheduling subpart of one of the course's configurations (if there are multiple). Also, the scheduling subparts can be nested which creates a parent-child relation between classes that also must be obeyed.

For more details, see for instance the Course Timetabling webinar available at http://www.unitime.org/webinars.php

DaemonSu commented 6 years ago

I think I get your point! THANKS A LOT!!!!

DaemonSu commented 6 years ago

hi tomas,I do some Experiment on the Binary Random CSP but the result is quite different from yours.If it's convenient for you,I want your Experimental detail Results.my email is sjbrising@163.com .

THANKS A LOT!!!!

tomas-muller commented 6 years ago

Last time I have experimented with the Binary Random CSP problem was for my doctoral thesis more than a decade ago. See http://muller.unitime.org/phd-thesis.pdf and http://muller.unitime.org/phd-cdrom.zip for more details. It contains the configuration files and the CPSolver as of the time I have done these experiments.