org.eviline.ai
Class DefaultAIKernel

java.lang.Object
  extended by org.eviline.ai.DefaultAIKernel
All Implemented Interfaces:
AIKernel

public class DefaultAIKernel
extends Object
implements AIKernel

Class which holds the AI algorithms. These algorithms are documented in the associated methods.

Author:
robin

Constructor Summary
DefaultAIKernel()
           
 
Method Summary
protected  Map<PlayerActionNode,List<PlayerAction>> allPathsFrom(Field field)
           
 Decision bestFor(Context context)
          Determine the shape that would be best for the player
 Decision bestFor(Context context, ShapeType type)
          Determine the best way for a player to play a single shape.
 Decision bestFor(Field inPlayField)
           
 Decision bestFor(QueueContext context)
          Determine the best way for a player to play a particular queue of shapes.
 AbstractFitness getFitness()
           
 boolean isHardDropOnly()
           
 boolean isHighGravity()
           
protected  List<PlayerAction> pathsTo(Field field, PlayerActionNode dest)
           
 Decision planBest(Context context, Decision defaultDecision)
          Determine the shape that would be best for the player
 Decision planWorst(Context context, Decision defaultDecision)
          Determine the shape that would be worst for the player
 void setFitness(Fitness fitness)
           
 void setHardDropOnly(boolean hardDropOnly)
           
 void setHighGravity(boolean highGravity)
           
 Decision worstFor(Context context)
          Determine the shape that would be worst for the player
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAIKernel

public DefaultAIKernel()
Method Detail

allPathsFrom

protected Map<PlayerActionNode,List<PlayerAction>> allPathsFrom(Field field)

pathsTo

protected List<PlayerAction> pathsTo(Field field,
                                     PlayerActionNode dest)

bestFor

public Decision bestFor(QueueContext context)
Determine the best way for a player to play a particular queue of shapes.

Specified by:
bestFor in interface AIKernel
Parameters:
context -
Returns:

bestFor

public Decision bestFor(Context context,
                        ShapeType type)
Determine the best way for a player to play a single shape.

Specified by:
bestFor in interface AIKernel
Parameters:
context -
type -
Returns:

bestFor

public Decision bestFor(Field inPlayField)
Specified by:
bestFor in interface AIKernel

bestFor

public Decision bestFor(Context context)
Determine the shape that would be best for the player

Specified by:
bestFor in interface AIKernel
Parameters:
context -
Returns:

planBest

public Decision planBest(Context context,
                         Decision defaultDecision)
Determine the shape that would be best for the player

Specified by:
planBest in interface AIKernel
Parameters:
context -
defaultDecision -
Returns:

worstFor

public Decision worstFor(Context context)
Determine the shape that would be worst for the player

Specified by:
worstFor in interface AIKernel
Parameters:
context -
Returns:

planWorst

public Decision planWorst(Context context,
                          Decision defaultDecision)
Determine the shape that would be worst for the player

Specified by:
planWorst in interface AIKernel
Parameters:
context -
defaultDecision -
Returns:

isHighGravity

public boolean isHighGravity()

setHighGravity

public void setHighGravity(boolean highGravity)

isHardDropOnly

public boolean isHardDropOnly()

setHardDropOnly

public void setHardDropOnly(boolean hardDropOnly)

getFitness

public AbstractFitness getFitness()
Specified by:
getFitness in interface AIKernel

setFitness

public void setFitness(Fitness fitness)
Specified by:
setFitness in interface AIKernel


Copyright © 2013. All Rights Reserved.