choco.cp.solver.constraints.global.pack
Class PackFiltering

java.lang.Object
  extended by choco.cp.solver.constraints.global.pack.PackFiltering

public final class PackFiltering
extends Object

The Class PackFiltering is implements filtering rules for one-dimensional bin packing constraint. In fact, all variables are not given. So, the constraint used an interface IPackSConstraint to get informations.
This class is a global constraint inspired from the 1BP constraint proposed by [1].
[1] Paul Shaw. A constraint for bin packing. In Mark Wallace, editor, Principles and Practice of Constraint Programming - CP 2004, 10th International Conference, CP 2004, Toronto, Canada, September 27 - October 1, 2004, Proceedings, volume 3258 of Lecture Notes in Computer Science, pages 648-662. Springer, 2004. [ http ]

Since:
2.0.0
Version:
2.0.1
Author:
Arnaud Malapert

Field Summary
 IPackSConstraint cstr
           
protected  BitMask flags
           
protected  IntDomainVar[] loads
          The loads of the bins.
protected  choco.cp.solver.constraints.global.pack.PackFiltering.SumDataStruct loadSum
           
protected  int[] sizes
          The sizes of the items.
 
Constructor Summary
PackFiltering(IPackSConstraint cstr, BitMask flags)
          Instantiates a new 1BP constraint.
 
Method Summary
protected  void cardAndItemsCoherence(int bin)
           
protected  void cardMaintenance(int bin)
           
protected  void loadAndSizeCoherence(int bin)
          The minimum and maximum load of each bin loads is maintained according to the domains of the bin assignment variables.
protected  void loadMaintenance(int bin)
          The minimum and maximum load of each bin loads is maintained according to the domains of the bin assignment variables.
protected  void noSumBinLoads(NoSumList nosum, int bin)
          Update the load of a given bin with no sum algorithm
protected  void noSumItemEliminationAndCommitment(NoSumList nosum, int bin)
          use no sum algorithm to pack into or remove from.
protected  void noSumPruningRule(NoSumList nosum, int bin)
          Feasibility test on the load of a given bin using no sum algorothm.
protected  void pack(int item, int bin)
          Do not update status
 void propagate()
           
protected  void remove(int item, int bin)
          Do not update status
protected  void singleItemEliminationAndCommitment(int bin)
          Single item elimination and commitment.
protected  void singleItemEliminationAndCommitmentAndFill(int bin)
           
protected  void updateInfLoad(int bin, int load)
          Update the minimal load of a given bin.
protected  void updateSupLoad(int bin, int load)
          Update the maximal load of a given bin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cstr

public final IPackSConstraint cstr

flags

protected final BitMask flags

sizes

protected final int[] sizes
The sizes of the items.


loads

protected final IntDomainVar[] loads
The loads of the bins.


loadSum

protected final choco.cp.solver.constraints.global.pack.PackFiltering.SumDataStruct loadSum
Constructor Detail

PackFiltering

public PackFiltering(IPackSConstraint cstr,
                     BitMask flags)
Instantiates a new 1BP constraint.

Parameters:
environment -
Method Detail

updateInfLoad

protected final void updateInfLoad(int bin,
                                   int load)
                            throws ContradictionException
Update the minimal load of a given bin.

Parameters:
bin - the index of bin
load - the new load
Throws:
ContradictionException - the contradiction exception

updateSupLoad

protected final void updateSupLoad(int bin,
                                   int load)
                            throws ContradictionException
Update the maximal load of a given bin.

Parameters:
bin - the index of bin
load - the new load
Throws:
ContradictionException - the contradiction exception

pack

protected final void pack(int item,
                          int bin)
                   throws ContradictionException
Do not update status

Throws:
ContradictionException

remove

protected final void remove(int item,
                            int bin)
                     throws ContradictionException
Do not update status

Throws:
ContradictionException

loadAndSizeCoherence

protected final void loadAndSizeCoherence(int bin)
                                   throws ContradictionException
The minimum and maximum load of each bin loads is maintained according to the domains of the bin assignment variables.

Parameters:
bin - the bin
Throws:
ContradictionException - the contradiction exception

cardAndItemsCoherence

protected final void cardAndItemsCoherence(int bin)
                                    throws ContradictionException
Throws:
ContradictionException

loadMaintenance

protected final void loadMaintenance(int bin)
                              throws ContradictionException
The minimum and maximum load of each bin loads is maintained according to the domains of the bin assignment variables.

Parameters:
bin - the index of the bin
Throws:
ContradictionException - the contradiction exception

cardMaintenance

protected final void cardMaintenance(int bin)
                              throws ContradictionException
Throws:
ContradictionException

singleItemEliminationAndCommitment

protected final void singleItemEliminationAndCommitment(int bin)
                                                 throws ContradictionException
Single item elimination and commitment.

Parameters:
bin - the bin
Throws:
ContradictionException - the contradiction exception

singleItemEliminationAndCommitmentAndFill

protected final void singleItemEliminationAndCommitmentAndFill(int bin)
                                                        throws ContradictionException
Parameters:
bin - the bin
Throws:
ContradictionException - the contradiction exception

noSumPruningRule

protected final void noSumPruningRule(NoSumList nosum,
                                      int bin)
                               throws ContradictionException
Feasibility test on the load of a given bin using no sum algorothm.

Throws:
ContradictionException - the contradiction exception

noSumBinLoads

protected final void noSumBinLoads(NoSumList nosum,
                                   int bin)
                            throws ContradictionException
Update the load of a given bin with no sum algorithm

Throws:
ContradictionException - the contradiction exception

noSumItemEliminationAndCommitment

protected final void noSumItemEliminationAndCommitment(NoSumList nosum,
                                                       int bin)
                                                throws ContradictionException
use no sum algorithm to pack into or remove from.

Throws:
ContradictionException - the contradiction exception

propagate

public void propagate()
               throws ContradictionException
Throws:
ContradictionException


Copyright © 2012. All Rights Reserved.