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
      • why

        public boolean why​(RuleStore ruleStore,
                           IntVar var,
                           IEventType evt,
                           int value)
        Description copied from interface: ICause
        Add new rules to the rule store
        Parameters:
        ruleStore - the rule store
        var - the modified variable
        evt - the undergoing event
        value - the value (for REMOVE only)
        Returns:
        true if at least one rule has been added to the rule store