|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.act365.sudoku.StrategyBase
com.act365.sudoku.LeastCandidatesCell
The LeastCandidatesCell strategy calculates the number of seemingly valid candidates (of course, for a problem with a unique solution, there is only one strictly valid candidate for each cell - a candidate is deemed 'seemingly valid' if it isn't blatantly contradicted by another cell in that row, column or subgrid) for each cell in the grid, and fills the cells with the least number of possible candidates first.
| Constructor Summary | |
LeastCandidatesCell(boolean randomize)
Creates a new LeastCandidatesCell instance. |
|
LeastCandidatesCell(boolean findMany,
boolean randomize,
boolean explain)
Creates a new LeastCandidatesCell instance. |
|
| Method Summary | |
int |
findCandidates()
Finds the cells that have the least number of candidates. |
void |
setup(Grid grid)
Sets the state variables. |
| Methods inherited from class com.act365.sudoku.StrategyBase |
explainsReasoning, getBestReason, getBestValue, getBestX, getBestY, getLastWrittenMove, getNumberOfCandidates, getReason, getReasonCandidate, getScore, getThreadLength, getThreadX, getThreadY, getValueCandidate, getXCandidate, getYCandidate, reset, reset, selectCandidate, setCandidate, toString, unwind, updateState |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.act365.sudoku.IStrategy |
explainsReasoning, getBestReason, getBestValue, getBestX, getBestY, getLastWrittenMove, getNumberOfCandidates, getReason, getReasonCandidate, getScore, getThreadLength, getThreadX, getThreadY, getValueCandidate, getXCandidate, getYCandidate, reset, reset, selectCandidate, setCandidate, toString, unwind, updateState |
| Constructor Detail |
public LeastCandidatesCell(boolean randomize)
randomize - whether the final candidate should be randomly chosen from the set of possibles
public LeastCandidatesCell(boolean findMany,
boolean randomize,
boolean explain)
findMany - whether an entire set of possible values should be foundrandomize - whether the final candidate should be randomly chosen from the set of possiblesexplain - whether explanatory debug should be produced| Method Detail |
public void setup(Grid grid)
throws java.lang.Exception
setup in interface IStrategyjava.lang.Exceptionpublic int findCandidates()
findCandidates in interface IStrategyIStrategy.findCandidates()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||