Dear Robert, A simple way to model the problem is to use finite set constraints. Use a set to represent a shift, instead of a list. The set contains the identifiers of the people in that shift. The advantage of sets is that most constraints are trivial to model. The only non-trivial one is to count how many times a given person appears in the shift: one has to use reification.
Below is attached a toy program that solves your basic problem (constraints 1-5). Feel free to play with it, and improve it. Cheers, raph On Mon, Jan 5, 2009 at 3:55 PM, Robert Hawkins <[email protected]> wrote: > > Greetings, > > 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. > > 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 > 2. each list should have *numOnCall* names > 3. each list must have unique names > 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) > 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") > > I would be happy if I could implement 1-5. Six and seven would be nice but > are not necessary. > > Thank you, > > Rob > > > Robert Hawkins > Software Engineer > FactSet Research Systems Inc. > * [email protected] | ( 212.849.4020 > > *FactSet Research Systems Inc.* <http://www.factset.com/> > > > _________________________________________________________________________________ > mozart-users mailing list > [email protected] > http://www.mozart-oz.org/mailman/listinfo/mozart-users >
staffsched.oz
Description: Binary data
_________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
