|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sat4j.AbstractLauncher
public abstract class AbstractLauncher
That class is used by launchers used to solve decision problems, i.e. problems with YES/NO/UNKNOWN answers.
| Field Summary | |
|---|---|
static String |
ANSWER_PREFIX
|
protected long |
beginTime
|
static String |
COMMENT_PREFIX
|
protected ExitCode |
exitCode
|
protected PrintWriter |
out
|
protected Reader |
reader
|
protected Thread |
shutdownHook
|
static String |
SOLUTION_PREFIX
|
protected ISolver |
solver
|
| Constructor Summary | |
|---|---|
protected |
AbstractLauncher()
|
| Method Summary | ||
|---|---|---|
protected abstract ISolver |
configureSolver(String[] args)
|
|
protected abstract Reader |
createReader(ISolver theSolver,
String problemname)
|
|
protected void |
displayHeader()
|
|
void |
displayLicense()
|
|
protected void |
displayResult()
|
|
long |
getBeginTime()
Obtaining the current time spent since the beginning of the solving process. |
|
ExitCode |
getExitCode()
Get the value of the ExitCode |
|
protected abstract String |
getInstanceName(String[] args)
|
|
PrintWriter |
getLogWriter()
|
|
Reader |
getReader()
|
|
void |
log(String message)
Display messages as comments on STDOUT |
|
protected IProblem |
readProblem(String problemname)
Reads a problem file from the command line. |
|
void |
run(String[] args)
|
|
void |
setExitCode(ExitCode exitCode)
Change the value of the exit code in the Launcher |
|
void |
setLogWriter(PrintWriter out)
To change the output stream on which statistics are displayed. |
|
protected void |
setSilent(boolean b)
|
|
protected
|
showAvailableSolvers(ASolverFactory<T> afactory)
|
|
protected void |
solve(IProblem problem)
|
|
abstract void |
usage()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SOLUTION_PREFIX
public static final String ANSWER_PREFIX
public static final String COMMENT_PREFIX
protected long beginTime
protected ExitCode exitCode
protected Reader reader
protected transient PrintWriter out
protected transient Thread shutdownHook
protected ISolver solver
| Constructor Detail |
|---|
protected AbstractLauncher()
| Method Detail |
|---|
protected void displayResult()
public abstract void usage()
protected final void displayHeader()
IOExceptionpublic void displayLicense()
protected IProblem readProblem(String problemname)
throws FileNotFoundException,
ParseFormatException,
IOException,
ContradictionException
problemname - the fully qualified name of the problem.
FileNotFoundException - if the file is not found
ParseFormatException - if the problem is not expressed using the right format
IOException - for other IO problems
ContradictionException - if the problem is found trivially unsat
protected abstract Reader createReader(ISolver theSolver,
String problemname)
public void run(String[] args)
protected abstract String getInstanceName(String[] args)
protected abstract ISolver configureSolver(String[] args)
public void log(String message)
message -
protected void solve(IProblem problem)
throws TimeoutException
TimeoutExceptionpublic final void setExitCode(ExitCode exitCode)
exitCode - the new ExitCodepublic final ExitCode getExitCode()
public final long getBeginTime()
public final Reader getReader()
public void setLogWriter(PrintWriter out)
out - public PrintWriter getLogWriter()
protected void setSilent(boolean b)
protected <T extends ISolver> void showAvailableSolvers(ASolverFactory<T> afactory)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||