Class VarsNeqRequirement

  • All Implemented Interfaces:
    GroundingRequirement

    public class VarsNeqRequirement
    extends java.lang.Object
    implements GroundingRequirement
    This class represents a single grounding requirement stating that two variables are not allowed to be substituted by the same constant.
    Author:
    Sebastian Homann
    • Constructor Summary

      Constructors 
      Constructor Description
      VarsNeqRequirement​(Variable first, Variable second)
      Creates a new grounding requirement for the two given variables that are not allowed to be set to the same constant in one ground instance.
    • Method Summary

      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      boolean isValid​(java.util.Map<Variable,​Constant> assignment)
      This method checks, if an assignment of constants to variables satisfies a given grounding condition.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • VarsNeqRequirement

        public VarsNeqRequirement​(Variable first,
                                  Variable second)
        Creates a new grounding requirement for the two given variables that are not allowed to be set to the same constant in one ground instance.
        Parameters:
        first - a variable.
        second - another variable.
    • Method Detail

      • isValid

        public boolean isValid​(java.util.Map<Variable,​Constant> assignment)
        Description copied from interface: GroundingRequirement
        This method checks, if an assignment of constants to variables satisfies a given grounding condition.
        Specified by:
        isValid in interface GroundingRequirement
        Parameters:
        assignment - the assignment to be validated.
        Returns:
        true, if the assignment satisfies this requirement.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object