Advertisement
makispaiktis

Node

Dec 10th, 2018 (edited)
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3. public class Node {
  4.     Node parent;
  5.     public ArrayList<Node> children;
  6.     int nodeDepth;
  7.     int[] nodeMove;
  8.     Board nodeBoard;
  9.     double nodeEvaluation;
  10.     int dice;
  11.    
  12.     // Constructors
  13.     public Node() {
  14.         //parent = new Node();
  15.         children = new ArrayList<Node>();
  16.         nodeDepth = 0;
  17.         nodeMove = new int[0];
  18.         nodeBoard = new Board();
  19.         nodeEvaluation = 0;    
  20.     }
  21.    
  22.     public Node(Node parent, int nodeDepth, Board gameBoard, double nodeEvaluation, int dice) {
  23.         this.parent = parent;
  24.         children = new ArrayList<Node>();
  25.         this.nodeDepth = nodeDepth;
  26.         nodeMove = new int[0];
  27.         this.nodeBoard = gameBoard;
  28.         this.nodeEvaluation = nodeEvaluation;
  29.         this.dice = dice;
  30.     }
  31.    
  32.     public Node(Node parent, int nodeDepth, Board gameBoard, double nodeEvaluation) {
  33.         this.parent = parent;
  34.         children = new ArrayList<Node>();
  35.         this.nodeDepth = nodeDepth;
  36.         nodeMove = new int[0];
  37.         this.nodeBoard = gameBoard;
  38.         this.nodeEvaluation = nodeEvaluation;
  39.     }
  40.    
  41.     public Node(int nodeDepth, Board gameBoard, double nodeEvaluation) {
  42.         parent = new Node();
  43.         children = new ArrayList<Node>();
  44.         this.nodeDepth = nodeDepth;
  45.         nodeMove = new int[0];
  46.         this.nodeBoard = gameBoard;
  47.         this.nodeEvaluation = nodeEvaluation;
  48.     }
  49.    
  50.     // Getters
  51.     public Board getBoard() {
  52.         return nodeBoard;
  53.     }
  54.    
  55.     public double getNodeEvaluation() {
  56.         return nodeEvaluation;
  57.     }
  58.    
  59.     public int getDice() {
  60.         return dice;
  61.     }
  62.    
  63.    
  64.    
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement