|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.rubik.solver.PruningTable
public class PruningTable
Constructs a pruning table from a pair of move mapping tables. The pruning table contains an entry corresponding to each possible pairing of entries from the two tables. Thus the number of pruning table entries is the product of the number of entries of the two move mapping tables. A breadth first search is performed until the table is filled. Each table entry contains the number of moves away from the cube home configuration that is required to reach that particular configuration. Since a breadth first search is performed, the distances are minimal and therefore they constitute an admissible heuristic. When an admissible heuristic is used to prune a heuristic search such as IDA*, the search is guaranteed to find an optimal (i.e. least number of moves possible) solution. This class has been derived from pruningt.cpp and pruningt.h from the 'Kociemba Cube Solver 1.0' (KCube) (c) Greg Schmidt.
| Constructor Summary | |
|---|---|
PruningTable(MoveTable moveTable1,
MoveTable moveTable2,
int homeOrdinal1,
int homeOrdinal2)
Constructor - Must provide a pair of move mapping tables and the associated ordinal corresponding to the cube's "home" configuration. |
|
| Method Summary | |
|---|---|
void |
dump()
Dump table contents. |
int |
getValue(int index)
Get a pruning table value corresponding to the specified index. |
void |
initialize(java.io.File file,
ProgressObserver pm,
java.lang.String pmNote)
Initialize the pruning table by either generating it or loading it from an existing file. |
int |
moveTableIndicesToPruningTableIndex(int ordinal1,
int ordinal2)
Convert a pair of move mapping table indices to the associated pruning table index. |
void |
setValue(int index,
int value)
Set a pruning table value at the specified index. |
int |
size()
Obtain the size of the table (number of logical entries). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PruningTable(MoveTable moveTable1,
MoveTable moveTable2,
int homeOrdinal1,
int homeOrdinal2)
| Method Detail |
|---|
public void initialize(java.io.File file,
ProgressObserver pm,
java.lang.String pmNote)
public int moveTableIndicesToPruningTableIndex(int ordinal1,
int ordinal2)
public int getValue(int index)
public void setValue(int index,
int value)
public int size()
public void dump()
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||