|
|||||||||||
| 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.LeastCandidatesNumber
The LeastCandidatesNumber strategy calculates, for each combination of number and sector (where a sector is a generic term that covers rows, columns and subgrids), the number of valid candidate cells and fills the the sectors with the least number of possible candidate cells first.
| Constructor Summary | |
LeastCandidatesNumber(boolean randomize)
Creates a new LeastCandidatesNumber instance to solve the given grid. |
|
LeastCandidatesNumber(boolean findMany,
boolean randomize,
boolean explain)
Creates a new LeastCandidatesNumber instance to solve the given grid. |
|
| Method Summary | |
int |
findCandidates()
Find the values and sectors 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 LeastCandidatesNumber(boolean randomize)
randomize - whether the final candidate should be randomly chosen from the set of possibles
public LeastCandidatesNumber(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 | ||||||||||