getAssignment() public method

public getAssignment ( Variable var ) : Object
var Variable
return Object
        /**
         * Primitive operation, which tries to prune out values from the CSP which
         * are not possible anymore when extending the given assignment to a
         * solution.
         *
         * @return An object which provides informations about (1) whether changes
         *         have been performed, (2) possibly inferred empty domains , and
         *         (3) how to restore the domains.
         */
        protected override DomainRestoreInfo inference(Variable var, Assignment assignment,
                                                       CSP csp)
        {
            switch (inferenceStrategy)
            {
            case FORWARD_CHECKING:
                return(doForwardChecking(var, assignment, csp));

            case AC3:
                return(new AC3Strategy().reduceDomains(var, assignment
                                                       .getAssignment(var), csp));

            default:
                return(new DomainRestoreInfo().compactify());
            }
        }
Exemplo n.º 2
0
 public override bool isSatisfiedWith(Assignment assignment)
 {
     Object value1 = assignment.getAssignment(var1);
     return value1 == null || !value1.Equals(assignment.getAssignment(var2));
 }
Exemplo n.º 3
0
        public override bool isSatisfiedWith(Assignment assignment)
        {
            Object value1 = assignment.getAssignment(var1);

            return(value1 == null || !value1.Equals(assignment.getAssignment(var2)));
        }
 /**
  * Primitive operation, which tries to prune out values from the CSP which
  * are not possible anymore when extending the given assignment to a
  * solution.
  * 
  * @return An object which provides informations about (1) whether changes
  *         have been performed, (2) possibly inferred empty domains , and
  *         (3) how to restore the domains.
  */
 protected override DomainRestoreInfo inference(Variable var, Assignment assignment,
         CSP csp)
 {
     switch (inferenceStrategy)
     {
         case FORWARD_CHECKING:
             return doForwardChecking(var, assignment, csp);
         case AC3:
             return new AC3Strategy().reduceDomains(var, assignment
                     .getAssignment(var), csp);
         default:
             return new DomainRestoreInfo().compactify();
     }
 }