constraints.lib.global

BinPacking

case class BinPacking (items: Array[IntVar], itemsizes: Array[IntVar], binsizes: Array[IntVar]) extends Constraint with Product with Serializable

This is the standard bin packing constraint

items

the items, designing the bins they are placed into

itemsizes

the size of the items

binsizes

the max size of the available bins

Linear Supertypes
Serializable, Serializable, Product, Equals, Constraint, IntInvariant, Invariant, PropagationElement, TarjanNode, DAGNode, Ordered[DAGNode], Comparable[DAGNode], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. BinPacking
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Constraint
  7. IntInvariant
  8. Invariant
  9. PropagationElement
  10. TarjanNode
  11. DAGNode
  12. Ordered
  13. Comparable
  14. AnyRef
  15. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BinPacking (items: Array[IntVar], itemsizes: Array[IntVar], binsizes: Array[IntVar])

    items

    the items, designing the bins they are placed into

    itemsizes

    the size of the items

    binsizes

    the max size of the available bins

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def < (that: DAGNode): Boolean

    Definition Classes
    Ordered
  5. def <= (that: DAGNode): Boolean

    Definition Classes
    Ordered
  6. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  7. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  8. def > (that: DAGNode): Boolean

    Definition Classes
    Ordered
  9. def >= (that: DAGNode): Boolean

    Definition Classes
    Ordered
  10. var DeterminingElements : List[PropagationElement]

    Definition Classes
    PropagationElement
  11. val DynamicallyListenedElements : PermaFilteredDoublyLinkedList[PropagationElement]

    Definition Classes
    PropagationElement
  12. var DynamicallyListenedElementsFromSameComponent : PermaFilteredDoublyLinkedList[PropagationElement]

    Definition Classes
    PropagationElement
  13. val DynamicallyListeningElements : PermaFilteredDoublyLinkedList[(PropagationElement, Any)]

    Definition Classes
    PropagationElement
  14. var DynamicallyListeningElementsFromSameComponent : PermaFilteredDoublyLinkedList[(PropagationElement, Any)]

    Definition Classes
    PropagationElement
  15. var InOneComponent : Boolean

    Definition Classes
    TarjanNode
  16. var Index : Int

    Definition Classes
    TarjanNode
  17. def InitiateDynamicGraphFromSameComponent (): Unit

    Definition Classes
    PropagationElement
  18. var IsBoundary : Boolean

    set to true if the PropagationElement is one that can break or make dependency cycles in the dynamic dependency graph managed by the PropagationComponent basically, set to true if the determiningElement is not in the same component and if this PropagationElement belongs to a cycle in the static dependency graph

    set to true if the PropagationElement is one that can break or make dependency cycles in the dynamic dependency graph managed by the PropagationComponent basically, set to true if the determiningElement is not in the same component and if this PropagationElement belongs to a cycle in the static dependency graph

    Definition Classes
    PropagationElement
  19. var LowLink : Int

    Definition Classes
    TarjanNode
  20. def MyMax : Int

    Definition Classes
    ConstraintIntInvariant
  21. def MyMin : Int

    Definition Classes
    ConstraintIntInvariant
  22. var OnStack : Boolean

    Definition Classes
    TarjanNode
  23. var Position : Int

    the position in the topological sort

    the position in the topological sort

    Definition Classes
    DAGNode
  24. var StaticallyListenedElements : List[PropagationElement]

    Definition Classes
    PropagationElement
  25. var StaticallyListeningElements : List[PropagationElement]

    Definition Classes
    PropagationElement
  26. var UniqueID : Int

    it gives the unique ID of the PropagationElement.

    it gives the unique ID of the PropagationElement. those uniqueID are expected to start at 0 and to increase continuously An exception is tolerated: UniqueID is set to -1 if the Propagation Element is not mentioned in the propagation structure, such as for constants yet is mentioned in the dependencies of registered propagation elements

    Definition Classes
    DAGNode
  27. val Violation : IntVar

  28. val Violations : SortedMap[IntVar, IntVar]

  29. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  30. val bincontents : Array[IntSetVar]

  31. val binfilling : Array[IntVar]

  32. val binsizes : Array[IntVar]

    the max size of the available bins

  33. val binviolations : Array[IntVar]

  34. def canEqual (arg0: Any): Boolean

    Definition Classes
    BinPacking → Equals
  35. def checkInternals (): Unit

    To override whenever possible to spot errors in invariants.

    To override whenever possible to spot errors in invariants. this will be called for each invariant after propagation is performed. It requires that the Model is instantiated with the varible debug set to true.

    Definition Classes
    InvariantPropagationElement
  36. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. def compare (that: DAGNode): Int

    Attributes
    final
    Definition Classes
    PropagationElement → Ordered
  38. def compareTo (that: DAGNode): Int

    Definition Classes
    Ordered → Comparable
  39. var component : StrognlyConnexComponent

    this refers to the propagationComponent that contains the PropagationElement.

    this refers to the propagationComponent that contains the PropagationElement. it is managed by the propagation structure

    Definition Classes
    PropagationElement
  40. var constrainedVariables : List[Variable]

    Definition Classes
    Constraint
  41. def decrementAndAccumulateFront (acc: List[PropagationElement]): List[PropagationElement]

    Definition Classes
    PropagationElement
  42. def decrementSucceedingAndAccumulateFront (acc: List[PropagationElement]): List[PropagationElement]

    Definition Classes
    PropagationElement
  43. def determineBoundary (): Unit

    this sets the value of IsBoundary according to the definition of this variable

    this sets the value of IsBoundary according to the definition of this variable

    returns

    the value of IsBoundary

    Definition Classes
    PropagationElement
  44. def dropStaticGraph (): Unit

    Definition Classes
    PropagationElement
  45. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  46. def equals (arg0: Any): Boolean

    Definition Classes
    BinPacking → Equals → AnyRef → Any
  47. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  48. def finishInitialization (model: Model = null): Unit

    this must be called by all invariant after they complete their initialization that is: before they get their output variable.

    this must be called by all invariant after they complete their initialization that is: before they get their output variable. This performs some registration to the model, which is discovered by exploring the variables that are statically registered to the model no more variable can be registered statically after this method has been called.

    Definition Classes
    Invariant
  49. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  50. def getConstrainedVariables : Iterable[Variable]

    returns the variables on which the constraint is posted.

    returns the variables on which the constraint is posted. These variables have an associated degree of violation. this is necessary to know on which variables the constraint is posted

    Definition Classes
    Constraint
  51. def getDAGPrecedingNodes : Iterable[DAGNode]

    Attributes
    final
    Definition Classes
    PropagationElementDAGNode
  52. def getDAGSucceedingNodes : Iterable[DAGNode]

    Attributes
    final
    Definition Classes
    PropagationElementDAGNode
  53. def getDeterminingElements : Iterable[PropagationElement]

    the variable that influence on the dependencies of the proapgation element these are propagated first to constitute the dynamic propagatoin graph

    the variable that influence on the dependencies of the proapgation element these are propagated first to constitute the dynamic propagatoin graph

    Definition Classes
    PropagationElement
  54. def getDotNode : String

    This returns the dot node to display on the DOT output for the node.

    This returns the dot node to display on the DOT output for the node. Only the argument of the nodes example: "[label= \"toto\" shape=diamond color=red]"

    Definition Classes
    InvariantPropagationElement
  55. def getDynamicallyListenedElements : Iterable[PropagationElement]

    Attributes
    final
    Definition Classes
    PropagationElement
  56. def getDynamicallyListeningElements : Iterable[(PropagationElement, Any)]

    Attributes
    final
    Definition Classes
    PropagationElement
  57. def getPropagationStructure : Model

    returns a reference to the propagationStructure where the PropagationElement is registered

    returns a reference to the propagationStructure where the PropagationElement is registered

    Definition Classes
    InvariantPropagationElement
  58. def getStaticallyListenedElements : Iterable[PropagationElement]

    through this method, the PropagationElement must declare which PropagationElement it is listening to in the static dependency graph.

    through this method, the PropagationElement must declare which PropagationElement it is listening to in the static dependency graph. The result must be stable after the call to setupPropagationStructure. to override

    Attributes
    final
    Definition Classes
    PropagationElement
  59. def getStaticallyListeningElements : Iterable[PropagationElement]

    through this method, the PropagationElement must declare which PropagationElement listen to it in the static dependency graph.

    through this method, the PropagationElement must declare which PropagationElement listen to it in the static dependency graph. The result must be stable after the call to setupPropagationStructure. to override

    Attributes
    final
    Definition Classes
    PropagationElement
  60. def getViolation (v: Variable): IntVar

    The violation of an item is the excess of the bin it is located into, ponderated by the relative size of the item.

    The violation of an item is the excess of the bin it is located into, ponderated by the relative size of the item. The violation of a bin is the excess in the bin

    Definition Classes
    BinPackingConstraint
  61. def getViolation : IntVar

    The violation of the constraint is the sum on all excess in all bins.

    The violation of the constraint is the sum on all excess in all bins.

    Definition Classes
    BinPackingConstraint
  62. def hashCode (): Int

    Definition Classes
    BinPacking → AnyRef → Any
  63. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  64. var isScheduled : Boolean

    set to true if the PropagationElement is scheduled for propagation, false otherwise.

    set to true if the PropagationElement is scheduled for propagation, false otherwise. this is managed by the PropagationElement

    Definition Classes
    PropagationElement
  65. def isTrue : Boolean

    facility to check that the constraint is enforced

    facility to check that the constraint is enforced

    Attributes
    final
    Definition Classes
    Constraint
  66. val items : Array[IntVar]

    the items, designing the bins they are placed into

  67. val itemsizes : Array[IntVar]

    the size of the items

  68. val itemviolations : Array[IntVar]

  69. var model : Model

    Definition Classes
    Invariant
  70. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  71. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  72. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  73. def notifyDeleteOn (v: IntSetVar, value: Int): Unit

    Definition Classes
    Invariant
  74. def notifyDeleteOn (v: IntSetVar, i: Int, value: Int): Unit

    Definition Classes
    Invariant
  75. def notifyDeleteOnAny (v: IntSetVar, i: Any, value: Int): Unit

    Definition Classes
    Invariant
  76. def notifyInsertOn (v: IntSetVar, value: Int): Unit

    Definition Classes
    Invariant
  77. def notifyInsertOn (v: IntSetVar, i: Int, value: Int): Unit

    Definition Classes
    Invariant
  78. def notifyInsertOnAny (v: IntSetVar, i: Any, value: Int): Unit

    Definition Classes
    Invariant
  79. def notifyIntChanged (v: IntVar, OldVal: Int, NewVal: Int): Unit

    Definition Classes
    Invariant
  80. def notifyIntChanged (v: IntVar, i: Int, OldVal: Int, NewVal: Int): Unit

    Definition Classes
    Invariant
  81. def notifyIntChangedAny (v: IntVar, i: Any, OldVal: Int, NewVal: Int): Unit

    Definition Classes
    Invariant
  82. def performPropagation (): Unit

    this is the propagation method that should be overridden by propagation elements.

    this is the propagation method that should be overridden by propagation elements. notice that it is only called in a propagation wave if: 1: it has been registered for propagation since the last time it was propagated 2: it is included in the propagation wave: partial propagation wave do not propagate all propagation elements; it only propagates the ones that come in the predecessors of the targeted propagation element overriding this method is optional, so an empty body is provided by default

    Definition Classes
    PropagationElement
  83. def productArity : Int

    Definition Classes
    BinPacking → Product
  84. def productElement (arg0: Int): Any

    Definition Classes
    BinPacking → Product
  85. def productIterator : Iterator[Any]

    Definition Classes
    Product
  86. def productPrefix : String

    Definition Classes
    BinPacking → Product
  87. def propagate (): Unit

    Performs the propagation, and some bookkeeping around it.

    Performs the propagation, and some bookkeeping around it.

    Definition Classes
    PropagationElement
  88. def registerConstrainedVariable (v: Variable): Unit

    This should be called by the constraint to declare the set of constrained variables.

    This should be called by the constraint to declare the set of constrained variables. this should be done at the same time as the registration for invariant API The sole purpose of this is to know which variable have an associated degree of violation this is not correlated wit the registration for dependencies in the invariants. eg: A constraint can constraint a variable, but subcontract the computation and implementation of the constraint to invariants notice that all variables sent here which are actually constants are not kept, as they are not variables, actually. This is tested by looking that the variable has a model associated.

    v

    the variable that is declared as constrained by the constraint

    Definition Classes
    Constraint
  89. def registerConstrainedVariables (v: Variable*): Unit

    Definition Classes
    Constraint
  90. def registerConstrainedVariablesAll (v: Iterable[Variable]): Unit

    Definition Classes
    Constraint
  91. def registerDeterminingDependency (v: Variable, i: Any = 1): Unit

    register to determining element.

    register to determining element. It must be in the static dependency graph

    Definition Classes
    Invariant
  92. def registerDeterminingElement (p: PropagationElement, i: Any): Unit

    must belong to the statically listened elements.

    must belong to the statically listened elements. cannot be added to the dynamically listened ones (it is added through this method, so you cannot remove it)

    p

    the element that determines the dynamic dependencies of the propagation element

    i

    an additional value that is stored in this element together with the reference to this, can be use for notification purposes

    Attributes
    protected final
    Definition Classes
    PropagationElement
  93. def registerDynamicDependency (v: Variable, i: Any = 1): KeyForElementRemoval

    Call this from within the invariant to notify that you will listen to this variable.

    Call this from within the invariant to notify that you will listen to this variable. The variable must be registered in the static propagation graph. You CANNOT register a variable twice. It is undetected, but will lead to unexpected behavior.

    v

    the variable that you want to listen to (and be notified about change)

    returns

    a handle that is required to remove the listened var from the dynamically listened ones

    Definition Classes
    Invariant
  94. def registerDynamicallyListenedElement (p: PropagationElement, i: Any): KeyForElementRemoval

    this registers to the element in the dynbamic propagation graph.

    this registers to the element in the dynbamic propagation graph. this element must have been registered o the static propagation graph before, or be accessible through a bulk

    p

    the element that we register to

    i

    a value that can be exploited by the element to notify its updates. normally, this value should be an int, if other type is used, the invariant should override a dedicated notification method.

    returns

    a key that is needed to unregister the element in the dynamic propagation graph

    Attributes
    protected
    Definition Classes
    PropagationElement
  95. def registerStaticAndDynamicDependencies (v: (Variable, Any)*): Unit

    Definition Classes
    Invariant
  96. def registerStaticAndDynamicDependenciesNoID (v: Variable*): Unit

    Definition Classes
    Invariant
  97. def registerStaticAndDynamicDependency (v: Variable, i: Any = 1): Unit

    this method is an alternative to the two call to the registration methods it performs the registration to the static and dynamic graphs at once.

    this method is an alternative to the two call to the registration methods it performs the registration to the static and dynamic graphs at once. just to spare one call

    v

    the variable that we want to register to

    i

    the integer value that will be passed to the invariant to notify some changes in the value of this variable

    Definition Classes
    Invariant
  98. def registerStaticAndDynamicDependencyAll (v: Iterable[(Variable, Any)]): Unit

    Definition Classes
    Invariant
  99. def registerStaticAndDynamicDependencyAllNoID (v: Iterable[Variable]): Unit

    Definition Classes
    Invariant
  100. def registerStaticAndDynamicDependencyArrayIndex (v: Array[Variable], offset: Int = 0): Unit

    registers static and dynamic dependency to all items in the array let be i, a position in the array, the idenx used for dynamic dependency registration is i+offset

    registers static and dynamic dependency to all items in the array let be i, a position in the array, the idenx used for dynamic dependency registration is i+offset

    v

    the variable that are registered

    offset

    and offset applied to the position in the array when reigstering the dynamic dependency

    Definition Classes
    Invariant
  101. def registerStaticDependencies (v: Variable*): Unit

    Definition Classes
    Invariant
  102. def registerStaticDependency (v: Variable): Unit

    Call this from within the invariant to notify that you will statically listen to this variable.

    Call this from within the invariant to notify that you will statically listen to this variable. You CANNOT register a variable twice. It is undetected, but will lead to unexpected behavior.

    v

    the variable that you want to listen to (and be notified about change)

    Definition Classes
    Invariant
  103. def registerStaticDependencyAll (v: Iterable[Variable]): Unit

    Definition Classes
    Invariant
  104. def registerStaticallyListenedElement (p: PropagationElement): Unit

    registers an element in the static dependency graph.

    registers an element in the static dependency graph. Beware that you also need to register elements in the dynamic propagation graph for something to happen.

    p

    the element that we register to

    Attributes
    protected final
    Definition Classes
    PropagationElement
  105. def scheduleForPropagation (): Unit

    to invoque to force inclusion of the propagation element in the current or next propagation wave.

    to invoque to force inclusion of the propagation element in the current or next propagation wave.

    Attributes
    final
    Definition Classes
    PropagationElement
  106. def setCounterToPrecedingCount (): Boolean

    Sets the Position oto the number of element that need to be decremented, not belonging to same connex component for connex component, set it to the number of element that are referenced from othercomponents

    Sets the Position oto the number of element that need to be decremented, not belonging to same connex component for connex component, set it to the number of element that are referenced from othercomponents

    returns

    true if there is a dependency, false otherwise

    Definition Classes
    PropagationElement
  107. def setOutputVar (v: IntVar): Unit

    the output var of a constraint is whether the constraint is true or not; it is not the violation degree

    the output var of a constraint is whether the constraint is true or not; it is not the violation degree

    v

    the variable that is the output variable of the invariant.

    Definition Classes
    ConstraintIntInvariant
  108. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  109. implicit def toIntVar : IntVar

    Attributes
    implicit
    Definition Classes
    IntInvariant
  110. def toString (): String

    Definition Classes
    BinPacking → AnyRef → Any
  111. def unregisterDynamicDependency (k: KeyForElementRemoval): Unit

    Call this from within the invariant to notify that you stop listen to this variable.

    Call this from within the invariant to notify that you stop listen to this variable. The variable must have been be registered in the static propagation graph.

    k

    the handle that was returned when the variable added to the dynamic graph

    Definition Classes
    Invariant
  112. def unregisterDynamicallyListenedElement (p: KeyForElementRemoval): Unit

    unregisters an element in the dynamic propagation graph.

    unregisters an element in the dynamic propagation graph.

    p

    the key that was given when the eement was registered in the dynamic propagation graph

    Attributes
    protected
    Definition Classes
    PropagationElement
  113. var visited : Boolean

    supposed to be false between each pass of the algorithm

    supposed to be false between each pass of the algorithm

    Definition Classes
    DAGNode
  114. var visited2 : Boolean

    Definition Classes
    DAGNode
  115. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  116. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  117. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Constraint

Inherited from IntInvariant

Inherited from Invariant

Inherited from PropagationElement

Inherited from TarjanNode

Inherited from DAGNode

Inherited from Ordered[DAGNode]

Inherited from Comparable[DAGNode]

Inherited from AnyRef

Inherited from Any