Class IntDecision

    • Constructor Detail

      • IntDecision

        public IntDecision​(PoolManager<IntDecision> poolManager)
        Create an decision based on an IntVar
        Parameters:
        poolManager - decision pool manager, to recycle decisions
    • Method Detail

      • getDecisionValue

        public Integer getDecisionValue()
        Description copied from class: Decision
        Return the value object involves in the decision
        Specified by:
        getDecisionValue in class Decision<IntVar>
        Returns:
        a value object
      • set

        public void set​(IntVar v,
                        int value,
                        DecisionOperator<IntVar> assignment)
        Instantiate this decision with the parameters
        Parameters:
        v - a variable
        value - a value
        assignment - a decision operator
      • reverse

        public void reverse()
        Description copied from class: Decision
        Reverse the decision operator
        Overrides:
        reverse in class Decision<IntVar>
      • free

        public void free()
        Description copied from class: Decision
        Free the decision, ie, it can be reused
        Specified by:
        free in class Decision<IntVar>
      • isEquivalentTo

        public boolean isEquivalentTo​(Decision dec)
        Overrides:
        isEquivalentTo in class Decision<IntVar>
        Parameters:
        dec - a decision
        Returns:
        true if the two decisions are equivalent (same variable, same operator, same value)
      • flip

        public IntDecision flip()
        Returns:
        a copy of this decision wherein the he decision operator is reversed
      • explain

        public void explain​(ExplanationForSignedClause explanation,
                            ValueSortedMap<IntVar> front,
                            Implications ig,
                            int p)
        Description copied from interface: ICause
        Clausal explanation for this cause.

        This method must filled explanations with inferred literals. These literals are inferred from the analysis of (a subset of) conflicting nodes stored in front, the implication graph ig and the current node in conflict, not yet contained in front.

        Optionally, this method can update front by looking for a predecessor of any node that seems more relevant than the declared one.

        Parameters:
        explanation - explanation to compute
        front - ordered map of (variable,node> in the conflict frontier of the implication graph.
        ig - an implication graph
        p - the pivot node out of front
      • forEachIntVar

        public void forEachIntVar​(Consumer<IntVar> action)
        Description copied from interface: ICause
        Apply an action on each variable declared on the scope of this cause, if any.
        Parameters:
        action - action to perform on each variable declared in this cause.