Hi,
I would like to use Oz to write a simple staff scheduler for my group's on call schedule. Can anyone recommend a good starting point for writing this program? An example program, a library I should use, or a tutorial? I looked at the examples included in Mozart Oz's documentation but none really fit my problem. My best guess right now is to use the Schedule library, though I'm not sure where interface documentation for that can be found.

I don't want to go into detail too much regarding your particular scenario, but it sounds very similar in essence to my final year undergraduate project I'm just about to complete. I am assigning university students to timetabled classes. As part of this I have to prevent the same student being in the same group more than once, prevent them being timetabled to classes that overlap in time, restrict each group to a fixed size, etc.

If I'm reading your description correctly, my suggestion for your problem would be to use Finite Sets by implementing a record to hold your solution, each feature would be a shift in numShifts and each corresponding field would be a finite set variable. (Representing people by an integer index within the set).
Here's a little more about the problem I want to solve..


The variables are:
numOnCall      = # of people on call at a time
numShifts      = # of shifts
lengthShift    = length of a shift (eg two weeks)
totalNumPeople = # of people available to be on call

Constraints are:
1. produce *numShifts* lists
Set up in your solution record
2. each list should have *numOnCall* names
FS.cardRange limits the cardinality of the set so {FS.cardRange 1 numOnCall <FS var>} would limit cardinality to between 1 and numOnCall
3. each list must have unique names
Each record feature is a set so this is implicit
4. a name that occurs in list n cannot occur in list (n+1) (ie, a person can't be on call twice in a row)
I'm only having a quick look here, but this sounds like you could use FS.disjoint or FS.disjointN (after collecting the relevant fields - see below) to specify that field X and field X+1 must have no intersection (in terms of sets). Ie a name in X cannot be in X+1. There is also a feature FS.exclude which explicitly removes a value from the set of potential values for a FS.var. NB collecting relevant fields - I used the collect facility of a basic for loop to collect together lists of FS.vars I was interested in before applying FS.disjointN on them.
5. names must appear an equal number of times (or as close to equal as possible) 6. distribution of names should be spaced out as much as possible over time (ie, don't make someone be on call only during the first half of the year) 7. try to spread out who is on call with who (ie, "john" should not always only be on call with "jane")
There are apparently a number of ways you can introduce cost functions into FS problems but I haven't dealt with these yet.

I sympathise with your quest for a suitable tutorial - there don't seem to be any! The following link has some interesting sections, although intended for NLP uses.
http://www.ps.uni-sb.de/~niehren/Web/Vorlesungen/Oz-NL-SS01/vorlesung/index.html

Also a good search of the user groups archives can be beneficial. I haven't finished my project yet as I still have to implement the actual distribute and search but I'd be happy to give you a copy of the code I've used to post my constraints if you think it might help.

Regards

Mark

--
Mark Richardson
Final year undergraduate
University of Teesside
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to