|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.act365.sudoku.Composer
A Composer object attempts to compose valid Su Doku puzzles with the MostCandidates strategy. It runs as a thread because composition is a lengthy process that the caller might well choose to terminate.
Field Summary | |
static int |
defaultThreads
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Composer(GridContainer gridContainer,
int boxesAcross,
int maxSolns,
int maxMasks,
int maxUnwinds,
int maxComplexity,
MaskFactory maskFactory,
int nSolvers,
int composeSolverThreshold,
java.io.PrintStream debug,
boolean useNative,
boolean leastCandidatesHybridFilter)
Generates a new thread that will attempt to construct a Su Doku puzzle with 'maskSize' cells on initial display. |
Method Summary | |
void |
addSolution(int solverIndex)
Called by a Solver object in order to indicate that a solution has been found. |
static void |
main(java.lang.String[] args)
Command-line app to compose Su Doku puzzles. |
void |
run()
Starts a Composer thread. |
void |
solverFinished(int solverIndex)
Called by a Solver object in order to indicate that all possible solutions to the puzzle have been considered. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int defaultThreads
Constructor Detail |
public Composer(GridContainer gridContainer, int boxesAcross, int maxSolns, int maxMasks, int maxUnwinds, int maxComplexity, MaskFactory maskFactory, int nSolvers, int composeSolverThreshold, java.io.PrintStream debug, boolean useNative, boolean leastCandidatesHybridFilter) throws java.lang.Exception
gridContainer
- object to be notified when a puzzle has been composedboxesAcross
- maxSolns
- maximum number of solutions to find (0 for no limit)maxMasks
- maximum number of masks to use (0 for no limit)maxUnwinds
- maximum permitted number of unwinds (0 for no limit)maxComplexity
- maximum permitted complexity (0 for no limit)maskFactory
- factory to generate the masksnSolvers
- number of solver threads to runcomposeSolverThreshold
- tree depth beyond which the compose solver will be invokeddebug
- optional debug stream (set to null for no debug)Method Detail |
public void addSolution(int solverIndex)
solverIndex
- index of the reporting solverSolver
public void solverFinished(int solverIndex)
solverIndex
- index of finished solverSolver
public void run()
Solver
public static void main(java.lang.String[] args)
Composer [-a across] [-d down] [-ms max solns|-mm max masks] [-mu max unwinds] [-s solvers] [-c threshold] [-r] [-v] -i|#cells
[-a across] [-d down]
define the dimensions of the puzzles to be composed. The default values are
three in each dimension.
[-ms max solns|-mm max masks]
defines optional termination conditions. The app will exit if max solns
puzzles have been generated or max masks
masks have been considered, whichever occurs sooner.
[-mu max unwinds]
stipulates a limit on the number of unwinds permitted on a single mask.
[-mu max unwinds]
stipulates a limit on the complexity permitted on a single mask.
[-s solvers]
stipulates the number of solver (or, equivalently, threads) to execute simultaneously. The default is 3.
[-c threshold]
stipulates the tree depth beyond which the compose solver will be invoked. The default value is 0.
[-r]
stipulates whether a random initial mask should be used. The default is no.
[-v]
stipualtes whether the Composer should run in verbose mode. The default is no.
[-n]
stipulates that the native library should be loaded
[-f]
stipulates that the output from the Least Candidates Hybrid compose solver should be filter, i.e. that LCH II should be used.
-i
stipulates that the initial mask should be read from standard input.
#cells
stipulates the number of initially-filled cells to appear in the puzzles.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |