CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik.solver
Class MoveTable

java.lang.Object
  extended by ch.randelshofer.rubik.solver.MoveTable
Direct Known Subclasses:
ChoiceMoveTable, CornerPermutationMoveTable, FlipMoveTable, MiddleSliceEdgePMvTbl, NonMiddleSliceEdgePMvTbl, TwistMoveTable

public abstract class MoveTable
extends java.lang.Object

An abstract base class used for creating move mapping tables. Functions for converting between an ordinal and its associated cube state must be overridden in the derived class. This class has been derived from movetabl.cpp and movetabl.h from the 'Kociemba Cube Solver 1.0' (KCube) (c) Greg Schmidt.

Version:
1.0.1 2003-03-16 Text provided to ProgressMonitor improved.
1.0 2000-07-01
Author:
Werner Randelshofer, Hausmatt 10, CH-6045 Immensee, Switzerland

Constructor Summary
MoveTable(Cube cube, int tableSize)
           
MoveTable(Cube cube, int tableSize, boolean phase2)
          The constructor must be provided with a cube to be manipulated during table generation, the size of the table (number of entries), and whether or not the table is a phase 2 table.
 
Method Summary
 void dump()
          Dump table contents.
 int get(int ordinal, int move)
          Overloaded subscript operator allows standard C++ indexing (i.e.
 void initialize(java.io.File file, ProgressObserver pm, java.lang.String tableName)
          Initialize the pruning table by either generating it or loading it from an existing file.
protected abstract  int ordinalFromCubeState()
           
protected abstract  void ordinalToCubeState(int ordinal)
           
 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

MoveTable

public MoveTable(Cube cube,
                 int tableSize,
                 boolean phase2)
The constructor must be provided with a cube to be manipulated during table generation, the size of the table (number of entries), and whether or not the table is a phase 2 table. If the table is a phase 2 table, then only quarter turn moves are allowed for F,B,L, and R.


MoveTable

public MoveTable(Cube cube,
                 int tableSize)
Method Detail

initialize

public void initialize(java.io.File file,
                       ProgressObserver pm,
                       java.lang.String tableName)
Initialize the pruning table by either generating it or loading it from an existing file.


get

public int get(int ordinal,
               int move)
Overloaded subscript operator allows standard C++ indexing (i.e. MoveTable[i][j]) for accessing table values.


size

public int size()
Obtain the size of the table (number of logical entries).


dump

public void dump()
Dump table contents.


ordinalFromCubeState

protected abstract int ordinalFromCubeState()

ordinalToCubeState

protected abstract void ordinalToCubeState(int ordinal)

(c) Werner Randelshofer.
All rights reserved.