|
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.Cube
public class Cube
A cube model containing basic cube definitions and cube operations. Applying a move maintains the proper cube permutation and orientation for each cubie. This class is designed to be subclassed in order to extend it to a specific type of cube useful for a particular solution method.
"x" denotes the chief facelets of cubicles. Cube faces not shown are symmetrical to the opposing face.
____ ____ ____
/_x_ /_x_ /_x_ /|
/_x_ /_U_ /_x_ /| |
/ x / x / x /| |/|
---- ---- ---- |/|x|
| | | |/|R|/|
---- ---- ---- x|/| |
| | F | |/| |/
---- ---- ---- |/
| | | |/
---- ---- ----
An edge cubie is sane if its chief facelet aligns with the chief
facelet of its current cubicle, otherwise it is flipped (MetaMagical
Themas - Hofstadter).
The orientation of a corner cubie can be determined by the number of 120 degree counter-clockwise twists required to align its chief facelet into a position that is parallel to the chief facelet of its home cubicle (August/September cube.lovers - Vanderschel/Saxe)
This class has been derived from cube.cpp and cube.h from the 'Kociemba Cube Solver 1.0' (KCube) (c) Greg Schmidt.
| Field Summary | |
|---|---|
static int |
ANTI_QUARK
|
static int |
B
|
static int |
B2
|
static int |
BD
|
static int |
BDR
|
static int |
BI
|
static int |
BL
|
static int |
BLD
|
static int |
BR
|
static int |
BRU
|
static int |
BU
|
static int |
BUL
|
protected int[] |
cornerCubieOrientations
|
protected int[] |
cornerCubiePermutations
The cubies. |
static int |
D
|
static int |
D2
|
static int |
DB
|
static int |
DBL
|
static int |
DF
|
static int |
DFR
|
static int |
DI
|
static int |
DL
|
static int |
DLF
|
static int |
DR
|
static int |
DRB
|
protected int[] |
edgeCubieOrientations
|
protected int[] |
edgeCubiePermutations
|
static int |
F
|
static int |
F2
|
static int |
FD
|
static int |
FDL
|
static int |
FI
|
static int |
FIRST_CORNER_CUBIE
|
static int |
FIRST_EDGE_CUBIE
|
static int |
FIRST_MIDDLE_SLICE_EDGE_CUBIE
|
static int |
FIRST_MOVE
|
static int |
FL
|
static int |
FLIPPED
|
static int |
FLU
|
static int |
FR
|
static int |
FRD
|
static int |
FU
|
static int |
FUR
|
static int |
INVALID_CUBIE
|
static int |
INVALID_MOVE
|
static int |
L
|
static int |
L2
|
static int |
LAST_CORNER_CUBIE
|
static int |
LAST_EDGE_CUBIE
|
static int |
LAST_MIDDLE_SLICE_EDGE_CUBIE
|
static int |
LAST_MOVE
|
static int |
LB
|
static int |
LBU
|
static int |
LD
|
static int |
LDB
|
static int |
LF
|
static int |
LFD
|
static int |
LI
|
static int |
LU
|
static int |
LUB
|
static int |
NO_QUARK
|
static int |
NOT_FLIPPED
|
static int |
NUMBER_OF_CLOCKWISE_QUARTER_TURN_MOVES
|
static int |
NUMBER_OF_CORNER_CUBIES
|
static int |
NUMBER_OF_EDGE_CUBIES
|
static int |
NUMBER_OF_MOVES
|
static int |
NUMBER_OF_TWISTS
|
static int |
QUARK
|
static int |
R
|
static int |
R2
|
static int |
RB
|
static int |
RBD
|
static int |
RD
|
static int |
RDF
|
static int |
RF
|
static int |
RFU
|
static int |
RI
|
static int |
RU
|
static int |
RUB
|
static int |
U
|
static int |
U2
|
static int |
UB
|
static int |
UBR
|
static int |
UF
|
static int |
UFL
|
static int |
UI
|
static int |
UL
|
static int |
ULB
|
static int |
UR
|
static int |
URF
|
| Constructor Summary | |
|---|---|
Cube()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
applyMove(int move)
Apply move. |
void |
backToHome()
Reset cube back to HOME position. |
protected void |
clockwiseTwist(int cornerCubie)
Corner cubie twists. |
java.lang.Object |
clone()
Clones the cube. |
protected void |
counterClockwiseTwist(int cornerCubie)
|
protected void |
cycleFour(int[] vector,
int first,
int second,
int third,
int fourth)
Cycle four vector elements. |
void |
dump()
Dump cube state. |
boolean |
equals(Cube cube)
Overloaded equality test method. |
boolean |
equals(java.lang.Object o)
Overriden equality test method. |
protected void |
flip(int edgeCubie)
Flip an edge cubie. |
protected void |
fourCycleCorner(int first,
int second,
int third,
int fourth)
Cycle four corner cubies. |
protected void |
fourCycleEdge(int first,
int second,
int third,
int fourth)
Cycle four edge cubies. |
int |
hashCode()
Overriden hashCode method. |
static int |
inverseOfMove(int move)
Get inverse of move. |
protected void |
moveB()
|
protected void |
moveB2()
|
protected void |
moveBI()
|
protected void |
moveD()
|
protected void |
moveD2()
|
protected void |
moveDI()
|
protected void |
moveF()
|
protected void |
moveF2()
|
protected void |
moveFI()
|
protected void |
moveL()
|
protected void |
moveL2()
|
protected void |
moveLI()
|
static int |
moveNameToMove(java.lang.String moveName)
Get the move from the move name. |
protected void |
moveR()
|
protected void |
moveR2()
|
protected void |
moveRI()
|
protected void |
moveU()
|
protected void |
moveU2()
|
protected void |
moveUI()
|
static java.lang.String |
nameOfMove(int move)
Get the name of a move. |
static int |
opposingFace(int move)
Get opposite face of a move. |
static int |
quarterTurnToHalfTurnMove(int move)
Turns a quarter turn move to a half turn move (e.g. |
void |
setState(int[] cornerPermutation,
int[] cornerOrientation,
int[] edgePermutation,
int[] edgeOrientation)
Set state from permutation and orientation vectors |
static Move |
symbolOfMove(int move)
Get the ScriptParser twist from a move. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UF
public static final int UL
public static final int UB
public static final int UR
public static final int FU
public static final int LU
public static final int BU
public static final int RU
public static final int DF
public static final int DL
public static final int DB
public static final int DR
public static final int FD
public static final int LD
public static final int BD
public static final int RD
public static final int RF
public static final int FL
public static final int LB
public static final int BR
public static final int FR
public static final int LF
public static final int BL
public static final int RB
public static final int FIRST_EDGE_CUBIE
public static final int LAST_EDGE_CUBIE
public static final int FIRST_MIDDLE_SLICE_EDGE_CUBIE
public static final int LAST_MIDDLE_SLICE_EDGE_CUBIE
public static final int NUMBER_OF_EDGE_CUBIES
public static final int URF
public static final int UFL
public static final int ULB
public static final int UBR
public static final int RFU
public static final int FLU
public static final int LBU
public static final int BRU
public static final int FUR
public static final int LUB
public static final int BUL
public static final int RUB
public static final int DFR
public static final int DLF
public static final int DBL
public static final int DRB
public static final int FRD
public static final int LFD
public static final int BLD
public static final int RBD
public static final int RDF
public static final int FDL
public static final int LDB
public static final int BDR
public static final int FIRST_CORNER_CUBIE
public static final int LAST_CORNER_CUBIE
public static final int NUMBER_OF_CORNER_CUBIES
public static final int INVALID_CUBIE
public static final int NO_QUARK
public static final int QUARK
public static final int ANTI_QUARK
public static final int NUMBER_OF_TWISTS
public static final int NOT_FLIPPED
public static final int FLIPPED
public static final int R
public static final int L
public static final int U
public static final int D
public static final int F
public static final int B
public static final int RI
public static final int LI
public static final int UI
public static final int DI
public static final int FI
public static final int BI
public static final int R2
public static final int L2
public static final int U2
public static final int D2
public static final int F2
public static final int B2
public static final int FIRST_MOVE
public static final int LAST_MOVE
public static final int NUMBER_OF_CLOCKWISE_QUARTER_TURN_MOVES
public static final int NUMBER_OF_MOVES
public static final int INVALID_MOVE
protected int[] cornerCubiePermutations
protected int[] cornerCubieOrientations
protected int[] edgeCubiePermutations
protected int[] edgeCubieOrientations
| Constructor Detail |
|---|
public Cube()
| Method Detail |
|---|
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic boolean equals(Cube cube)
public int hashCode()
hashCode in class java.lang.Objectpublic void backToHome()
public void setState(int[] cornerPermutation,
int[] cornerOrientation,
int[] edgePermutation,
int[] edgeOrientation)
public void applyMove(int move)
public static int inverseOfMove(int move)
public static int quarterTurnToHalfTurnMove(int move)
public static int opposingFace(int move)
public static java.lang.String nameOfMove(int move)
public static int moveNameToMove(java.lang.String moveName)
public static Move symbolOfMove(int move)
ScriptParserpublic void dump()
public java.lang.String toString()
toString in class java.lang.Objectprotected void moveR()
protected void moveL()
protected void moveU()
protected void moveD()
protected void moveF()
protected void moveB()
protected void moveRI()
protected void moveLI()
protected void moveUI()
protected void moveDI()
protected void moveFI()
protected void moveBI()
protected void moveR2()
protected void moveL2()
protected void moveU2()
protected void moveD2()
protected void moveF2()
protected void moveB2()
protected void fourCycleEdge(int first,
int second,
int third,
int fourth)
protected void fourCycleCorner(int first,
int second,
int third,
int fourth)
protected void cycleFour(int[] vector,
int first,
int second,
int third,
int fourth)
protected void flip(int edgeCubie)
protected void clockwiseTwist(int cornerCubie)
protected void counterClockwiseTwist(int cornerCubie)
public java.lang.Object clone()
clone in class java.lang.Object
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||