<commit_before>package com.hearthsim.util.tree;

import java.util.ArrayList;
import java.util.List;

import com.hearthsim.util.BoardState;
import com.hearthsim.util.StateFunction;

/**
 * A tree that keeps track of possible game states
 *
 */
public class HearthTreeNode {

	public final BoardState data_;
	double score_;
	int numNodesTried_;
	
	HearthTreeNode parent_;
	List<HearthTreeNode> children_;
	
	private class NodeValPair {
		public final HearthTreeNode node_;
		public final double value_;
		
		NodeValPair(HearthTreeNode node, double value) {
			node_ = node;
			value_ = value;
		}
	}
	
	public HearthTreeNode(BoardState data) {
		this(data, 0.0);
	}
	
	public HearthTreeNode(BoardState data, double score) {
		data_ = data;
		score_ = score;
		parent_ = null;
		children_ = null;
	}
	
	public int getNumNodesTried() {
		return numNodesTried_;
	}
	
	public void setNumNodesTries(int value) {
		numNodesTried_ = value;
	}
	
	public double getScore() {
		return score_;
	}
	
	public void setScore(double value) {
		score_ = value;
	}

	public HearthTreeNode addChild(BoardState childData, double score) {
		HearthTreeNode childNode = new HearthTreeNode(childData, score);
		childNode.parent_ = this;
		if (children_ == null) {
			children_ = new ArrayList<HearthTreeNode>();
		}
		children_.add(childNode);
		return childNode;
	}
	
	public HearthTreeNode addChild(HearthTreeNode node) {
		node.parent_ = this;
		if (children_ == null) {
			children_ = new ArrayList<HearthTreeNode>();
		}
		children_.add(node);
		return node;
	}
	
	public void clearChildren() {
		children_.clear();
	}
	
	public List<HearthTreeNode> getChildren() {<commit_msg>parent node not needed<commit_after>package com.hearthsim.util.tree;

import java.util.ArrayList;
import java.util.List;

import com.hearthsim.util.BoardState;
import com.hearthsim.util.StateFunction;

/**
 * A tree that keeps track of possible game states
 *
 */
public class HearthTreeNode {

	public final BoardState data_;
	double score_;
	int numNodesTried_;
	
	List<HearthTreeNode> children_;
	
	private class NodeValPair {
		public final HearthTreeNode node_;
		public final double value_;
		
		NodeValPair(HearthTreeNode node, double value) {
			node_ = node;
			value_ = value;
		}
	}
	
	public HearthTreeNode(BoardState data) {
		this(data, 0.0);
	}
	
	public HearthTreeNode(BoardState data, double score) {
		data_ = data;
		score_ = score;
		children_ = null;
	}
	
	public int getNumNodesTried() {
		return numNodesTried_;
	}
	
	public void setNumNodesTries(int value) {
		numNodesTried_ = value;
	}
	
	public double getScore() {
		return score_;
	}
	
	public void setScore(double value) {
		score_ = value;
	}

	public HearthTreeNode addChild(BoardState childData, double score) {
		HearthTreeNode childNode = new HearthTreeNode(childData, score);
		if (children_ == null) {
			children_ = new ArrayList<HearthTreeNode>();
		}
		children_.add(childNode);
		return childNode;
	}
	
	public HearthTreeNode addChild(HearthTreeNode node) {
		if (children_ == null) {
			children_ = new ArrayList<HearthTreeNode>();
		}
		children_.add(node);
		return node;
	}
	
	public void clearChildren() {
		children_.clear();
	}
	
	public List<HearthTreeNode> getChildren() {
{'fraction_non_alphanumeric': 0.09637434149364735, 'fraction_numerical': 0.0012395413696932136, 'mean_word_length': 4.091482649842272, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2228189', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1051, 'n_words': 269}