Bin Packing Problem

Tripti Saxena tripti.saxena at gmail.com
Tue May 29 21:52:01 CEST 2007


Hello ,
   I am beginner to Mozart and am trying to code something which is a
modified version of the bin packing example given along with mozart.

apart from the basic capacity constraint that the bin packing has , my code
also needs to have an additional constraint where each component and bin is
associated with a number

eg components ca , cb, cc,cd and ce are components to be put into A , B , C
bins
each component is associated with a number
ca (10) , cb (10) , cc(10) , cd (20) , ce (20).


and each bin is also associated with a number A(10) , B(10) and C (20).

A constraint should make sure and along with the capacity constraints , the
number on the component and the bin should match .

I tried using something like


          BB = (({List.nth CN 1}mod 10) == 0)

to check whether the number associated with component 1 actually matches
that of bin 1 ( i .e . 10 in this case) and then assocrdingly i try to
assign it to a bin using assignment statement. The rest of the constraint
make sure that the componenet is allocated to ony one bin and not divided
and slipt over bins. (the example by default splits the component into parts
and does that)

          if BB then (A.ca = 2) else (B.ca = 2) end
          {Browse BB}
          {FD.impl A.ca>:0  B.ca=:0 1}
          {FD.impl A.ca>:0  C.ca=:0 1}
          {FD.impl B.ca>:0  A.ca=:0 1}
          {FD.impl B.ca>:0  C.ca=:0 1}
          {FD.impl C.ca>:0  A.ca=:0 1}
          {FD.impl C.ca>:0  B.ca=:0 1}

but this piece of code suspends. I am not sure why .

Can someone help me

Regards,
Tripti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gforge.info.ucl.ac.be/pipermail/mozart-users/attachments/20070529/6f8246b3/attachment.html


More information about the mozart-users mailing list