Class FixedBoolVarImpl

    • Constructor Detail

      • FixedBoolVarImpl

        public FixedBoolVarImpl​(String name,
                                int constant,
                                Model model)
    • Method Detail

      • getTypeAndKind

        public int getTypeAndKind()
        Description copied from interface: Variable
        Return a MASK composed of 2 main information: TYPE and KIND.
        TYPE is defined in the 3 first bits : VAR ( 1 << 0), CSTE (1 << 1) or VIEW (1 << 2)
        KIND is defined on the other bits : INT (1 << 3), BOOL (INT + 1 << 4), GRAPH (1 << 5) or META (1 << 6)

        To get the TYPE of a variable:

         int type = var.getTypeAndKind() & Variable.TYPE;
         

        To get the KIND of a variable:

         int kind = var.getTypeAndKind() & Variable.KIND;
         

        To check a specific type or kind of a variable:

             boolean isVar = (var.getTypeAndKind() & Variable.VAR) !=0;
             boolean isInt = (var.getTypeAndKind() & Variable.INT) !=0;
         
        Specified by:
        getTypeAndKind in interface Variable
        Overrides:
        getTypeAndKind in class FixedIntVarImpl
        Returns:
        an int representing the type and kind of the variable
      • not

        public BoolVar not()
        Specified by:
        not in interface BoolVar
        Specified by:
        not in interface ReExpression
        Returns:
        return the expression "¬x" where this is "x"
      • isLit

        public boolean isLit()
        Description copied from interface: ILogical
        Current tree is a literal
        Specified by:
        isLit in interface ILogical
        Returns:
        true if this is a literal
      • hasNot

        public boolean hasNot()
        Specified by:
        hasNot in interface BoolVar
      • isNot

        public boolean isNot()
        Description copied from interface: ILogical
        Current tree is rooted with NOT logical operator This is a one way relationship: in case a = not(b) a.isNot() returns true whereas b.isNot() returns false (unless b = not(c)...)
        Specified by:
        isNot in interface ILogical
        Returns:
        true if this is NOT
      • setNot

        public void setNot​(boolean isNot)
        Description copied from interface: ILogical
        States whether or not this variable is the negation of another. This is a one way relationship: in case a = not(b) a.isNot() returns true whereas b.isNot() returns false (unless b = not(c)...)
        Specified by:
        setNot in interface ILogical
        Parameters:
        isNot - true iff this variable is the negation of another