Class ConstraintSatisfactionProblem

    • Constructor Detail

      • ConstraintSatisfactionProblem

        public ConstraintSatisfactionProblem()
        Creates a new and empty csp.
      • ConstraintSatisfactionProblem

        public ConstraintSatisfactionProblem​(Collection<? extends Statement> statements)
        Creates a new csp with the given statements
        Parameters:
        statements - a collection of statements.
    • Method Detail

      • toNormalizedForm

        public ConstraintSatisfactionProblem toNormalizedForm()
        Normalizes this problem, i.e. every constraint is brought into an equivalent form "T> 0" or "T >= 0" or "T = 0" or "T != 0".
        Returns:
        a csp.
      • isLinear

        public boolean isLinear()
        Checks whether every constraint of this problem is linear.
        Returns:
        "true" if every constraint of this problem is linear.
      • isInteger

        public boolean isInteger()
        Checks whether this problem is integer, i.e. whether all variables are integer variables.
        Returns:
        "true" if this problem is integer.
      • isMinimumFree

        public boolean isMinimumFree()
        Checks whether this problem uses no minimum function.
        Returns:
        "true" if this problem uses no minimum function.
      • resolveMinimums

        public void resolveMinimums()
        Resolves all occurrences of minimums by substituting a minimum "min{a,b}" by "0.5 a + 0.5 b - abs(a-b)".
      • resolveMaximums

        public void resolveMaximums()
        Resolves all occurrences of maximums by substituting a maximum "max{a,b}" by "0.5 a + 0.5 b + abs(a-b)".
      • getVariables

        public Set<Variable> getVariables()
        Returns all variables of this problem.
        Returns:
        all variables of this problem.
      • getMinimums

        public Set<Minimum> getMinimums()
        Returns all minimums appearing in this problem.
        Returns:
        all minimums appearing in this problem.
      • collapseAssociativeOperations

        public void collapseAssociativeOperations()
        This method collapses all associative operations appearing in the target function and the constraints, e.g. every min{min{a,b},c} becomes min{a,b,c}