Package util

Examples of util.ESat


     * Presumably, not all variables are instantiated.
     */
    public ESat isSatisfied() {
        int OK = 0;
        for (int c = 0; c < cIdx; c++) {
            ESat satC = cstrs[c].isSatisfied();
            if (ESat.FALSE == satC) {
                if (LoggerFactory.getLogger("solver").isErrorEnabled()) {
                    LoggerFactory.getLogger("solver").error("FAILURE >> {} ({})", cstrs[c].toString(), satC);
                }
                return ESat.FALSE;
View Full Code Here


     * <code>ESat.UNDIFINED</code> otherwise (more decisions/filtering must be made before concluding about constraint satisfaction)
     */
    public ESat isSatisfied() {
        int sat = 0;
        for (int i = 0; i < propagators.length; i++) {
            ESat entail = propagators[i].isEntailed();
            if (entail.equals(ESat.FALSE)) {
                return entail;
            } else if (entail.equals(ESat.TRUE)) {
                sat++;
            }
        }
        if (sat == propagators.length) {
            return ESat.TRUE;
View Full Code Here

    }


    @Override
    public void propagate(int evtmask) throws ContradictionException {
        ESat condition = checkCondition();
        if (condition == ESat.TRUE) {
            setPassive();
            for (Constraint cstr : condTrue) {
                postTemp(cstr);
            }
View Full Code Here

        this.original = original;
    }

    @Override
    public void propagate(int evtmask) throws ContradictionException {
        ESat op = original.isSatisfied();
        if (op == ESat.TRUE) {
            contradiction(vars[0], "");
        }
        if (op == ESat.FALSE) {
            setPassive();
View Full Code Here

        }
    }

    @Override
    public ESat isEntailed() {
        ESat op = original.isSatisfied();
        if (op == ESat.TRUE) {
            return ESat.FALSE;
        }
        if (op == ESat.FALSE) {
            return ESat.TRUE;
View Full Code Here

                reifCons.activate(0);
            } else {
                reifCons.activate(1);
            }
        } else {
            ESat sat = trueCons.isSatisfied();
            if (sat == ESat.TRUE) {
                setPassive();
                bVar.setToTrue(aCause);
                reifCons.activate(0);
            } else if (sat == ESat.FALSE) {
View Full Code Here

            } else {
                return falseCons.isSatisfied();
            }
        } else {
            // a constraint an its opposite can neither be both true nor both false
            ESat tie = trueCons.isSatisfied();
            if (tie != ESat.UNDEFINED) {
                ESat fie = falseCons.isSatisfied();
                if (tie == fie) {
                    return ESat.FALSE;
                }
            }
        }
View Full Code Here

    miniSat = (PropSat) propagators[0];
  }

  @Override
  public ESat isSatisfied() {
    ESat so = ESat.UNDEFINED;
    for (int i = 0; i < propagators.length; i++) {
      so = propagators[i].isEntailed();
      if (!so.equals(ESat.TRUE)) {
        return so;
      }
    }
    return so;
  }
View Full Code Here

  /**
   * Close the search, restore the last solution if any,
   * and set the feasibility and optimality variables.
   */
  private void close() {
    ESat sat = ESat.FALSE;
    if (measures.getSolutionCount() > 0) {
      sat = ESat.TRUE;
      if (objectivemanager.isOptimization()) {
        measures.setObjectiveOptimal(!hasReachedLimit);
      }
View Full Code Here


    @Override
    public ESat isEntailed() {
        for (INogood ng : allnogoods) {
            ESat sat = ng.isEntailed();
            if (!sat.equals(ESat.TRUE)) {
                return sat;
            }
        }
        return ESat.TRUE;
    }
View Full Code Here

TOP

Related Classes of util.ESat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.