Class FailedElements


  • public class FailedElements
    extends java.lang.Object
    Part of the FailedRules. This class stores violated elements detected during a reasoning process.
    Author:
    El-Sharkawy, Sizonenko
    • Constructor Detail

      • FailedElements

        public FailedElements()
        Creates a new FailedElements instance, which can be used for exact one reasoning process. This constructor is only package visible, as it should only be used inside of the FailedElements class.
    • Method Detail

      • addProblemConstraint

        public void addProblemConstraint​(Constraint constraint,
                                         FailedElementDetails details)
        Method for adding failed constraints and associated details.
        Parameters:
        constraint - Failed constraint.
        details - Failed constraint details.
      • removeProblemConstraint

        public void removeProblemConstraint​(Constraint constraint)
        Removes a problem point through its constraint.
        Parameters:
        constraint - Constraint to be declared valid/irrelevant for problems.
      • removeProblemConstraints

        public void removeProblemConstraints​(java.util.List<Constraint> constraints)
        Removes problem points through several constraint.
        Parameters:
        constraints - the constraints to be declared valid/irrelevant for problems.
      • addProblemVariable

        public void addProblemVariable​(AbstractVariable variable,
                                       FailedElementDetails details)
        Method for adding failed variable and associated IDecisionVariable.
        Parameters:
        variable - Failed variable.
        details - Associated details.
      • hasProblems

        public boolean hasProblems()
        Returns whether constraint violations or variable assignment were detected during the related reasoning process.
        Returns:
        true if at least one errors was reported to this instance, false otherwise.
      • problemConstraintCount

        public int problemConstraintCount()
        Returns the number of problem constraints.
        Returns:
        the number of problem constraints.
      • problemVariabletCount

        public int problemVariabletCount()
        Returns the number of problem variables.
        Returns:
        the number of problem variables.
      • getProblemConstraints

        public java.util.Iterator<Constraint> getProblemConstraints()
        Returns a Iterator - problem Constraints.
        Returns:
        The failed constraints.
      • getProblemVariables

        public java.util.Iterator<AbstractVariable> getProblemVariables()
        Returns a Iterator - problem AbstractVariables.
        Returns:
        Problem variables.
      • clear

        public void clear()
        Clears this instance.