[Oz] timetable - nursery problem

Fulek Roman Roman.Fulek at swh.sk
Tue Jan 12 19:28:15 CET 1999


Hello Oz users,

currently I am working on a Nursery timetable problem. I have got stuck
as I want to write a MinConsec constraint/propagator? stating that a
particular person must work at least at N consecutive shifts. I could
find quite easily the opposite, stating that the person may not work
more then N times consecutively.
The schedule is a list of lists and may look like [[1 2][1 2 3][2 4][3
4][5 6]]
Which means that at the first shift persons 1,2 are active, next shift
persons 1,2,3 ...
I don't know how to write it and I don't know if it is even possible.
Could anyone help me ? (I have made several versions, but my program
always stayed frozen, giving no result)

This is a fragment of my program.

local
   proc {PropagMaxConsec NConsec Ss PersonN}
      case Ss of nil then skip
      else  {FD.atMost NConsec {Flatten {List.take Ss NConsec+1}}
PersonN}
      end
   end
in
   proc {MaxConsec Schedule Max}
      case Schedule
      of nil then skip
      [] TimeUnit|Sr then
	 {For 1 NPersons 1
	  proc {$ PersonN}
	     {PropagMaxConsec Max TimeUnit|Sr PersonN}
	  end
	 }
	 {MaxConsec Sr Max}
      else skip end
   end
end

declare
proc {MakeSchedule Schedule}
   Schedule={MakeList NTimeUnits}
   {MakeTimeUnits Schedule Demands} 
   {CreateDomains Schedule Demands}
   {ForAll Schedule proc {$ TimeUnit}{ApplyOrder TimeUnit} end}
   {MaxUsage Schedule MaxTotal}
   {MaxConsec Schedule MaxConsecutive}

   %distribution
   {ForAll Schedule proc {$ TimeUnit} {FD.distribute ff TimeUnit}end}
end

{Browse {SearchOne MakeSchedule}}

Also I wish to use FUZZY arithmetics for the cost function. Could anyone
point me at some example ? This must not be a program in Oz, anything
can help.

with sincere greetings,

Roman

-
Please send submissions to oz-users at dfki.de,
administriva mail to oz-users-request at dfki.de.
The Oz web site is at http://www.ps.uni-sb.de/oz/.





More information about the mozart-users mailing list