Class EvalVisitor

    • Constructor Detail

      • EvalVisitor

        public EvalVisitor()
        Creates an evaluation visitor.
      • EvalVisitor

        public EvalVisitor​(IConfiguration config,
                           IAssignmentState assignmentState,
                           boolean assignmentsOnly,
                           IValueChangeListener listener)
        Constructor for initializing superclass.
        Parameters:
        config - the configuration to take already evaluated values from
        assignmentState - the state for the assignments (may be null if no assignment shall take place)
        assignmentsOnly - if true process only assignments, else process all constraints
        listener - listener a listener to notify some external mechanism about a changed variable
    • Method Detail

      • setScopeAssignments

        public void setScopeAssignments​(ScopeAssignments scopeAssignments)
        Method for setting ScopeAssignments register to check if variable was already assigned in this scope.
        Parameters:
        scopeAssignments - register.
      • getTargetState

        protected IAssignmentState getTargetState​(IDecisionVariable var)
        Description copied from class: EvaluationVisitor
        Returns the target state for a variable which is actually being assigned. This method is intended to be overriden if state conflicts shall be checked before assignment.
        Overrides:
        getTargetState in class EvaluationVisitor
        Parameters:
        var - variable
        Returns:
        the target state for the variable, may be null if assignment is not permitted
      • isAssignable

        private boolean isAssignable​(IDecisionVariable var,
                                     IDecisionVariable compound)
        Method for determining if variable is valid for value assignment.
        Parameters:
        var - Variable to be checked.
        compound - Parent compound (might be null).
        Returns:
        true if assignment is valid.
      • wasAssignedInThisScope

        private boolean wasAssignedInThisScope​(IDecisionVariable var,
                                               IDecisionVariable compound)
        Method for determining if variable was already aasigned in this scope.
        Parameters:
        var - Variable to be checked.
        compound - Parent compound (might be null).
        Returns:
        true if assignment is valid.