knockabout.gamemodel
Class CompiledMove

java.lang.Object
  extended byknockabout.gamemodel.CompiledMove

public class CompiledMove
extends java.lang.Object

A compiled move describes all the translations caused by the sourceMove It is faster to apply a compiledMove than a move because, as the name implies, the consequences of the move are already computed, but applying a CompiledMove only make sense if the board is in the same state as it was when the CompiledMove was generated. Note that no tests are done to enforce this condition (for performance reasons) so one should be careful before applying a CompiledMove Used frequently in conjunction of compiledMove.getInverse() in the context of recursive search methods


Constructor Summary
CompiledMove()
           
 
Method Summary
 float getEvaluatedUtility()
           
 Die getRerolledDie()
           
 Move getSourceMove()
           
 java.util.List getTranslations()
           
 CompiledMove inverse()
          The inverse has the property that
state.applyCompiledMove(mc);
state.applyCompiledMove(mc.inverse();
will leave the state unchanged
 void setEvaluatedUtility(float f)
           
 void setRerolledDie(Die die)
           
 void setSourceMove(Move move)
           
 void setTranslations(java.util.List set)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompiledMove

public CompiledMove()
Method Detail

inverse

public CompiledMove inverse()
The inverse has the property that
state.applyCompiledMove(mc);
state.applyCompiledMove(mc.inverse();
will leave the state unchanged

Returns:

getRerolledDie

public Die getRerolledDie()
Returns:

getSourceMove

public Move getSourceMove()
Returns:

getTranslations

public java.util.List getTranslations()
Returns:

setRerolledDie

public void setRerolledDie(Die die)
Parameters:
die -

setSourceMove

public void setSourceMove(Move move)
Parameters:
move -

setTranslations

public void setTranslations(java.util.List set)
Parameters:
set -

toString

public java.lang.String toString()

getEvaluatedUtility

public float getEvaluatedUtility()
Returns:

setEvaluatedUtility

public void setEvaluatedUtility(float f)
Parameters:
f -