|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.carlosbcruz.engine.BoardSolver
public class BoardSolver
Apply a backtrack algorith to solve the board problem.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
BoardSolver(Board boardToBeSolver)
Thread that will work on a specific board. |
Method Summary | |
---|---|
Board |
getLastFoundSolution()
Return the last found soulution. |
int |
getNumberOfSolutions()
Inform the number of solutions found. |
int |
getStepsAnalyzed()
Get the number of steps executed. |
boolean |
isStopAtFirstSolution()
Indicate if the flat stop after a solution is set or not. |
void |
run()
|
void |
setExitRequested(boolean exitRequested)
Request the solver to exit. |
void |
setStopAtFirstSolution(boolean stopAtFirstSolution)
set if the it is required to stop after a solution. |
boolean |
solveBoard(Board board)
Start the seek for a solution. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BoardSolver(Board boardToBeSolver)
boardToBeSolver
- Method Detail |
---|
public void setExitRequested(boolean exitRequested)
exitRequested
- The exitRequested to set.public int getNumberOfSolutions()
public boolean isStopAtFirstSolution()
public void setStopAtFirstSolution(boolean stopAtFirstSolution)
stopAtFirstSolution
- The stopAtFirstSolution to set.public int getStepsAnalyzed()
public Board getLastFoundSolution()
public boolean solveBoard(Board board)
board
- the problem describe in the board
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |