public class Tree
extends java.lang.Object
Constructor and Description |
---|
Tree(int diff,
PlayingField afield)
Create a node that acts as the root of a new tree.
|
Modifier and Type | Method and Description |
---|---|
int |
alpha_beta_pruning(Node node,
int depth,
int a,
int b,
boolean isComp)
The alpha beta and minimax combination.
|
int |
minimaxAB(int diff)
The initialization of the minimax algorithm.
|
public Node topNode
public Tree(int diff, PlayingField afield)
diff
- The difficulty of the computer player that this tree is used for.afield
- The playing field that represents the current field of the game.public int minimaxAB(int diff)
diff
- The difficulty of the computer player.public int alpha_beta_pruning(Node node, int depth, int a, int b, boolean isComp)
node
- A node in the tree. Contains function to determine it's heuristic value.depth
- The depth in the tree. depth == 0 indicates the node is a leaf.a
- Alphab
- BetaisComp
- Keeps track of max or minplayer.