org.sat4j.opt
Class AbstractSelectorVariablesDecorator

java.lang.Object
  extended by org.sat4j.tools.SolverDecorator
      extended by org.sat4j.opt.AbstractSelectorVariablesDecorator
All Implemented Interfaces:
java.io.Serializable, IProblem, ISolver
Direct Known Subclasses:
MaxSatDecorator, WeightedMaxSatDecorator

public abstract class AbstractSelectorVariablesDecorator
extends SolverDecorator

See Also:
Serialized Form

Field Summary
protected  int nbnewvar
           
protected  int nborigvars
           
protected  int[] prevfullmodel
           
 
Constructor Summary
AbstractSelectorVariablesDecorator(ISolver solver)
           
 
Method Summary
 boolean admitABetterSolution()
           
 int[] model()
          Provide a model (if any) for a satisfiable formula.
 int newVar(int howmany)
          Create howmany variables in the solver (and thus in the vocabulary).
 void reset()
          Clean up the internal state of the solver.
 void setExpectedNumberOfClauses(int nb)
          To inform the solver of the expected number of clauses to read.
 
Methods inherited from class org.sat4j.tools.SolverDecorator
addAllClauses, addAtLeast, addAtMost, addClause, addPseudoBoolean, clearLearntClauses, decorated, findModel, findModel, getStat, getTimeout, isSatisfiable, isSatisfiable, model, nConstraints, newVar, nVars, printStat, printStat, removeConstr, setTimeout, setTimeoutMs, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nborigvars

protected int nborigvars

nbnewvar

protected int nbnewvar

prevfullmodel

protected int[] prevfullmodel
Constructor Detail

AbstractSelectorVariablesDecorator

public AbstractSelectorVariablesDecorator(ISolver solver)
Method Detail

model

public int[] model()
Description copied from interface: IProblem
Provide a model (if any) for a satisfiable formula. That method should be called AFTER isSatisfiable() or isSatisfiable(IVecInt) if the formula is satisfiable. Else an exception UnsupportedOperationException is launched.

Specified by:
model in interface IProblem
Overrides:
model in class SolverDecorator
Returns:
a model of the formula as an array of literals to satisfy.
See Also:
IProblem.isSatisfiable(), IProblem.isSatisfiable(IVecInt)

newVar

public int newVar(int howmany)
Description copied from interface: ISolver
Create howmany variables in the solver (and thus in the vocabulary).

Specified by:
newVar in interface ISolver
Overrides:
newVar in class SolverDecorator
Parameters:
howmany - number of variables to create
Returns:
the total number of variables available in the solver (the highest variable number)

setExpectedNumberOfClauses

public void setExpectedNumberOfClauses(int nb)
Description copied from interface: ISolver
To inform the solver of the expected number of clauses to read. This is an optional method, that is called when the p cnf line is read in dimacs formatted input file.

Specified by:
setExpectedNumberOfClauses in interface ISolver
Overrides:
setExpectedNumberOfClauses in class SolverDecorator
Parameters:
nb - the expected number of clauses.

reset

public void reset()
Description copied from interface: ISolver
Clean up the internal state of the solver.

Specified by:
reset in interface ISolver
Overrides:
reset in class SolverDecorator

admitABetterSolution

public boolean admitABetterSolution()
                             throws TimeoutException
Throws:
TimeoutException


Copyright © 2007 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.