|
|||||||||||
| 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.LeastCandidatesHybrid
LeastCandidatesHybrid combines the Least Candidates Cell and Least Candidates Number strategies.
| Constructor Summary | |
LeastCandidatesHybrid(boolean randomize,
boolean explain)
Sets up a LeastCandidatesHybrid I strategy with an optional random element. |
|
LeastCandidatesHybrid(boolean randomize,
boolean checkInvulnerable,
boolean useAllLogicalMethods,
boolean explain)
Sets up a LeastCandidatesHybrid II strategy with an optional random element. |
|
| Method Summary | |
int |
findCandidates()
Finds candidates for the next move. |
int |
getLastWrittenMove()
Determines the last move for which two or more alternatives existed. |
java.lang.String |
printState(int stateType)
Prints the current state grid of the given type. |
void |
setup(Grid grid)
Sets up the strategy to solve the given grid. |
java.lang.String |
toString()
Dumps the thread to the given output stream. |
boolean |
unwind(int newNMoves,
boolean reset,
boolean eliminate)
Unwind the stack. |
boolean |
updateState(int x,
int y,
int value,
java.lang.String reason,
boolean writeState)
Updates state variables. |
| Methods inherited from class com.act365.sudoku.StrategyBase |
explainsReasoning, getBestReason, getBestValue, getBestX, getBestY, getNumberOfCandidates, getReason, getReasonCandidate, getScore, getThreadLength, getThreadX, getThreadY, getValueCandidate, getXCandidate, getYCandidate, reset, reset, selectCandidate, setCandidate |
| 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, getNumberOfCandidates, getReason, getReasonCandidate, getScore, getThreadLength, getThreadX, getThreadY, getValueCandidate, getXCandidate, getYCandidate, reset, reset, selectCandidate, setCandidate |
| Constructor Detail |
public LeastCandidatesHybrid(boolean randomize,
boolean checkInvulnerable,
boolean useAllLogicalMethods,
boolean explain)
randomize - whether the final candidates should be chosen randomly from its peerscheckInvulnerable - indicates whether the moves should be post-filtered using the Invulnerable state grid.useAllLogicalMethods - whether the solver should look for X-Wings and Nishioexplain - whether explanatory debug should be produced
public LeastCandidatesHybrid(boolean randomize,
boolean explain)
| Method Detail |
public void setup(Grid grid)
throws java.lang.Exception
setup in interface IStrategyjava.lang.ExceptionIStrategy.setup(Grid)public int findCandidates()
findCandidates in interface IStrategyIStrategy.findCandidates()
public boolean updateState(int x,
int y,
int value,
java.lang.String reason,
boolean writeState)
throws java.lang.Exception
updateState in interface IStrategyupdateState in class StrategyBasejava.lang.ExceptionIStrategy.updateState(int,int,int,String,boolean)
public boolean unwind(int newNMoves,
boolean reset,
boolean eliminate)
unwind in interface IStrategyunwind in class StrategyBaseIStrategy.unwind(int,boolean,boolean)public int getLastWrittenMove()
getLastWrittenMove in interface IStrategygetLastWrittenMove in class StrategyBasepublic java.lang.String printState(int stateType)
public java.lang.String toString()
toString in interface IStrategytoString in class StrategyBase
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||