Uses of Class
ai.nettogrof.battlesnake.treesearch.node.AbstractNode
-
Packages that use AbstractNode Package Description ai.nettogrof.battlesnake.snakes This package contains all "Snakes" classesai.nettogrof.battlesnake.treesearch Contains everything related to tree searchai.nettogrof.battlesnake.treesearch.node Contain Abstract Node classai.nettogrof.battlesnake.treesearch.search.constrictor Contains search and node classes related to constrictor modeai.nettogrof.battlesnake.treesearch.search.fun Contains fun search to prevent our snake to do certain thingsai.nettogrof.battlesnake.treesearch.search.royale Contains search and node classes related to royale modeai.nettogrof.battlesnake.treesearch.search.royale.wrapped ai.nettogrof.battlesnake.treesearch.search.squad Contains search and node classes related to squad modeai.nettogrof.battlesnake.treesearch.search.standard Contains search and node classes related to standard mode -
-
Uses of AbstractNode in ai.nettogrof.battlesnake.snakes
Fields in ai.nettogrof.battlesnake.snakes declared as AbstractNode Modifier and Type Field Description protected AbstractNodeAbstractTreeSearchSnakeAI. lastRootKeep the root node from the previous move, to be able to continue search from the previous "tree"Methods in ai.nettogrof.battlesnake.snakes that return AbstractNode Modifier and Type Method Description private AbstractNodeAbstractSearchSnakeAI. checkWinLost(AbstractNode winner, AbstractNode root, Map<String,String> response)Check if it's a win or lostprotected AbstractNodeAbstractTreeSearchSnakeAI. chooseBestMove(AbstractNode root)Choose the best move, based on the assumption that the opponent will always choose the best counter.protected AbstractNodeAbstractTreeSearchSnakeAI. findChildNewRoot(List<SnakeInfo> snakes, FoodInfo food, HazardSquare hazard)Check in the previous search if a child from root, is equals the current board situation.,protected abstract AbstractNodeAbstractSearchSnakeAI. finishHim(AbstractNode root, AbstractNode winner)In a winning position, this method try to find the shortest way to win.protected AbstractNodeAbstractTreeSearchSnakeAI. finishHim(AbstractNode root, AbstractNode winner)In a winning position, this method try to find the shortest way to win.protected AbstractNodeExpertSnake. genNode(List<SnakeInfo> snakes, FoodInfo food, HazardSquare hazard)This method generate the root node typeprotected abstract AbstractNodeAbstractTreeSearchSnakeAI. genRoot(com.fasterxml.jackson.databind.JsonNode moveRequest)Generate the root node based on the /move requestprotected AbstractNodeExpertSnake. genRoot(com.fasterxml.jackson.databind.JsonNode moveRequest)Generate the root node based on the /move requestprotected abstract AbstractNodeAbstractSearchSnakeAI. lastChance(AbstractNode root)In a losing position, this method try to find the longest way, hpoing that the opponent make a mistake.protected AbstractNodeAbstractTreeSearchSnakeAI. lastChance(AbstractNode root)In a losing position, this method try to find the longest way, hpoing that the opponent make a mistake.Methods in ai.nettogrof.battlesnake.snakes with parameters of type AbstractNode Modifier and Type Method Description private AbstractNodeAbstractSearchSnakeAI. checkWinLost(AbstractNode winner, AbstractNode root, Map<String,String> response)Check if it's a win or lostprotected AbstractNodeAbstractTreeSearchSnakeAI. chooseBestMove(AbstractNode root)Choose the best move, based on the assumption that the opponent will always choose the best counter.private voidAbstractTreeSearchSnakeAI. fillList(gnu.trove.list.array.TFloatArrayList[] upward, gnu.trove.list.array.TFloatArrayList[] down, gnu.trove.list.array.TFloatArrayList[] left, gnu.trove.list.array.TFloatArrayList[] right, AbstractNode node)This method fill 4 list (one for each direction ) with the score of each node based on the move directionprotected abstract AbstractNodeAbstractSearchSnakeAI. finishHim(AbstractNode root, AbstractNode winner)In a winning position, this method try to find the shortest way to win.protected AbstractNodeAbstractTreeSearchSnakeAI. finishHim(AbstractNode root, AbstractNode winner)In a winning position, this method try to find the shortest way to win.protected Map<String,String>AbstractSearchSnakeAI. generateResponse(AbstractNode winner, AbstractNode root, com.fasterxml.jackson.databind.JsonNode head)Generate the response to send, adding a shout if in winning/losing position.private intAbstractTreeSearchSnakeAI. getMaxDepth(AbstractNode root)Check the depth of the biggest branchprotected abstract AbstractNodeAbstractSearchSnakeAI. lastChance(AbstractNode root)In a losing position, this method try to find the longest way, hpoing that the opponent make a mistake.protected AbstractNodeAbstractTreeSearchSnakeAI. lastChance(AbstractNode root)In a losing position, this method try to find the longest way, hpoing that the opponent make a mistake.protected voidAbstractMultiThreadSnakeAI. multiThreadtreeSearch(AbstractNode root, Long startTime, GameRuleset rules)Execute the multiThread tree searchvoidAbstractTreeSearchSnakeAI. singleThreadTreeSearch(AbstractNode root, Long startTime, GameRuleset rules)Execute the single Thread tree searchprotected voidAbstractMultiThreadSnakeAI. treeSearch(AbstractNode root, Long startTime, GameRuleset rules)Execute the tree searchprotected voidAbstractTreeSearchSnakeAI. treeSearch(AbstractNode root, Long startTime, GameRuleset rules)Execute the tree searchMethod parameters in ai.nettogrof.battlesnake.snakes with type arguments of type AbstractNode Modifier and Type Method Description protected voidAbstractMultiThreadSnakeAI. expand(List<AbstractNode> nodelist, List<AbstractNode> expandedlist, GameRuleset rules)Expand the base list of node until reaching CPU limit -
Uses of AbstractNode in ai.nettogrof.battlesnake.treesearch
Fields in ai.nettogrof.battlesnake.treesearch declared as AbstractNode Modifier and Type Field Description protected AbstractNodeAbstractSearch. rootRoot node for the searchMethods in ai.nettogrof.battlesnake.treesearch that return AbstractNode Modifier and Type Method Description AbstractNodeAbstractBestFirstSearch. getBestChild(AbstractNode node)This method find and return the best leaf nodeprotected AbstractNodeAbstractSearch. getSmallestChild(AbstractNode node)Get the leaf from the smallest branchprivate AbstractNodeAbstractBestFirstSearch. getWinnerChild(AbstractNode node)Get the best child/winner from a nodeMethods in ai.nettogrof.battlesnake.treesearch that return types with arguments of type AbstractNode Modifier and Type Method Description protected List<AbstractNode>AbstractBestFirstSearch. getBestPath(AbstractNode node)This method is use to find the next leaf node to explore using MCTS algoprotected List<AbstractNode>AbstractMCTS. getMCTSBestPath(AbstractNode node)This method is use to find the next leaf node to explore using MCTS algoprotected List<AbstractNode>AbstractBestFirstSearch. updateListNode(List<AbstractNode> branch)This method get a branch, update score starting from the leaf.Methods in ai.nettogrof.battlesnake.treesearch with parameters of type AbstractNode Modifier and Type Method Description protected voidAbstractSearch. addMove(int newhead, List<SnakeInfo> allSnakes, SnakeInfo snakeInfo, AbstractNode node, List<SnakeInfo> listNewSnakeInfo)This method add move to the list if the snake can move in the new head position.protected abstract SnakeInfoAbstractSearch. createSnakeInfo(SnakeInfo snakeInfo, int newHead, AbstractNode node)Create new SnakeInfo based on the current node and the new head squareprivate voidAbstractBestFirstSearch. fillList(gnu.trove.list.array.TFloatArrayList upward, gnu.trove.list.array.TFloatArrayList down, gnu.trove.list.array.TFloatArrayList left, gnu.trove.list.array.TFloatArrayList right, AbstractNode node)This method fill 4 list (one for each direction ) with the score of each node based on the move directionprivate voidAbstractMCTS. fillMCTSList(gnu.trove.list.array.TFloatArrayList upward, gnu.trove.list.array.TFloatArrayList down, gnu.trove.list.array.TFloatArrayList left, gnu.trove.list.array.TFloatArrayList right, AbstractNode node)This method fill 4 list (one for each direction ) with the score of each node based on the move directionprotected voidAbstractSearch. generateChild(AbstractNode node)Expand / Generate child from a nodeprotected List<SnakeInfo>AbstractSearch. generateSnakeInfoDestination(SnakeInfo snakeInfo, AbstractNode node, List<SnakeInfo> allSnakes)Generate all moves possible for a snake given.AbstractNodeAbstractBestFirstSearch. getBestChild(AbstractNode node)This method find and return the best leaf nodeprotected List<AbstractNode>AbstractBestFirstSearch. getBestPath(AbstractNode node)This method is use to find the next leaf node to explore using MCTS algoprotected List<AbstractNode>AbstractMCTS. getMCTSBestPath(AbstractNode node)This method is use to find the next leaf node to explore using MCTS algoprotected AbstractNodeAbstractSearch. getSmallestChild(AbstractNode node)Get the leaf from the smallest branchprivate AbstractNodeAbstractBestFirstSearch. getWinnerChild(AbstractNode node)Get the best child/winner from a nodeprivate floatAbstractMCTS. mctsScore(AbstractNode parentNode, AbstractNode childNode)Calculation of the Upper Confident Bound score.protected voidAbstractSearch. moveSnake(SnakeInfo snakeInfo, AbstractNode node, List<SnakeInfo> allSnakes, List<SnakeInfo> listNewSnakeInfo)Generate move of a snakeMethod parameters in ai.nettogrof.battlesnake.treesearch with type arguments of type AbstractNode Modifier and Type Method Description protected voidAbstractBestFirstSearch. mergeList(List<AbstractNode> tree, List<AbstractNode> branch)This method just merge two lists and remove the duplicate nodeprotected voidAbstractBestFirstSearch. updateFullListNode(List<AbstractNode> tree)This method updateScore from each nodeprotected List<AbstractNode>AbstractBestFirstSearch. updateListNode(List<AbstractNode> branch)This method get a branch, update score starting from the leaf. -
Uses of AbstractNode in ai.nettogrof.battlesnake.treesearch.node
Subclasses of AbstractNode in ai.nettogrof.battlesnake.treesearch.node Modifier and Type Class Description classAbstractDecisionNodeThis abstract node class is the based of all node class, provide basic update Score Currently using Paranoid only, I hope to add MaxN soonclassAbstractEvaluationNodeThis abstract evaluation node class is the based of all node class methods evaluation, provide evaluation method use in any node.Fields in ai.nettogrof.battlesnake.treesearch.node with type parameters of type AbstractNode Modifier and Type Field Description protected List<AbstractNode>AbstractNode. childList of child nodeMethods in ai.nettogrof.battlesnake.treesearch.node that return AbstractNode Modifier and Type Method Description abstract AbstractNodeAbstractNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Create a node from the same typestatic AbstractNodeNodeUtil. getBestNode(AbstractNode node)Get the best childstatic AbstractNodeNodeUtil. getSmallestNode(AbstractNode root)Return the small child (in size) that are still expendableMethods in ai.nettogrof.battlesnake.treesearch.node that return types with arguments of type AbstractNode Modifier and Type Method Description List<AbstractNode>AbstractNode. getChild()Gets list of child from this nodeMethods in ai.nettogrof.battlesnake.treesearch.node with parameters of type AbstractNode Modifier and Type Method Description voidAbstractNode. addChild(AbstractNode newChild)Add a child to this nodeabstract AbstractNodeAbstractNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Create a node from the same typestatic AbstractNodeNodeUtil. getBestNode(AbstractNode node)Get the best childstatic AbstractNodeNodeUtil. getSmallestNode(AbstractNode root)Return the small child (in size) that are still expendable -
Uses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.constrictor
Subclasses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.constrictor Modifier and Type Class Description classConstrictorNodeThis Constrictor node class must be use only in constrictor mode.Methods in ai.nettogrof.battlesnake.treesearch.search.constrictor that return AbstractNode Modifier and Type Method Description AbstractNodeConstrictorNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Uses to create constrictor nodeMethods in ai.nettogrof.battlesnake.treesearch.search.constrictor with parameters of type AbstractNode Modifier and Type Method Description AbstractNodeConstrictorNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Uses to create constrictor nodeprotected SnakeInfoConstrictorSearch. createSnakeInfo(SnakeInfo snake, int newHead, AbstractNode node)Constructors in ai.nettogrof.battlesnake.treesearch.search.constrictor with parameters of type AbstractNode Constructor Description ConstrictorSearch(AbstractNode root, int width, int height)Constructor used to expand the tree once.ConstrictorSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search. -
Uses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.fun
Methods in ai.nettogrof.battlesnake.treesearch.search.fun with parameters of type AbstractNode Modifier and Type Method Description protected SnakeInfoLimitedMoveRoyaleSearch. createSnakeInfo(SnakeInfo snake, int newHead, AbstractNode currentNode)protected List<SnakeInfo>LimitedMoveRoyaleSearch. generateSnakeInfoDestination(SnakeInfo snakeInfo, AbstractNode node, List<SnakeInfo> allSnakes)Generate all moves possible for a snake given.protected voidLimitedMoveRoyaleSearch. selfDestination(int head, List<SnakeInfo> allSnakes, SnakeInfo snakeInfo, AbstractNode node, List<SnakeInfo> listNewSnakeInfo)Generate all move possible for our snake, and check the snake direction to prevent some move.Constructors in ai.nettogrof.battlesnake.treesearch.search.fun with parameters of type AbstractNode Constructor Description LimitedMoveRoyaleSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search. -
Uses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.royale
Subclasses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.royale Modifier and Type Class Description classAbstractRoyaleNodeThis abstract royale node class is the based of all node class, provide basic method use in any node for royale rules.classRoyaleDuelNodeThis Royale Duel node class must be use when only 2 snakes left, and in royale mode.classRoyaleFourNodeThis Royale FourNode class must be use when only 3 or 4 snakes left, and in royale mode.Methods in ai.nettogrof.battlesnake.treesearch.search.royale that return AbstractNode Modifier and Type Method Description AbstractNodeRoyaleDuelNode. createNode(List<SnakeInfo> snakeInfo, AbstractNode currentNode)Uses to create royale duel nodeAbstractNodeRoyaleFourNode. createNode(List<SnakeInfo> snakeInfo, AbstractNode currentNode)Uses to create fourNode typeMethods in ai.nettogrof.battlesnake.treesearch.search.royale with parameters of type AbstractNode Modifier and Type Method Description AbstractNodeRoyaleDuelNode. createNode(List<SnakeInfo> snakeInfo, AbstractNode currentNode)Uses to create royale duel nodeAbstractNodeRoyaleFourNode. createNode(List<SnakeInfo> snakeInfo, AbstractNode currentNode)Uses to create fourNode typeprotected SnakeInfoAbstractRoyaleSearch. createSnakeInfo(SnakeInfo snake, int newHead, AbstractNode currentNode)Constructors in ai.nettogrof.battlesnake.treesearch.search.royale with parameters of type AbstractNode Constructor Description AbstractRoyaleSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search.RoyaleSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search. -
Uses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.royale.wrapped
Subclasses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.royale.wrapped Modifier and Type Class Description classWrappedRoyaleNodeThis Royale FourNode class must be use when only 3 or 4 snakes left, and in royale mode.Methods in ai.nettogrof.battlesnake.treesearch.search.royale.wrapped that return AbstractNode Modifier and Type Method Description AbstractNodeWrappedRoyaleNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Methods in ai.nettogrof.battlesnake.treesearch.search.royale.wrapped with parameters of type AbstractNode Modifier and Type Method Description AbstractNodeWrappedRoyaleNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)protected List<SnakeInfo>WrappedRoyaleSearch. generateSnakeInfoDestination(SnakeInfo snakeInfo, AbstractNode node, List<SnakeInfo> allSnakes)Constructors in ai.nettogrof.battlesnake.treesearch.search.royale.wrapped with parameters of type AbstractNode Constructor Description WrappedRoyaleSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search. -
Uses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.squad
Subclasses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.squad Modifier and Type Class Description classSquadNodeThis Squad node class must be in squad modeMethods in ai.nettogrof.battlesnake.treesearch.search.squad that return AbstractNode Modifier and Type Method Description AbstractNodeSquadNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Methods in ai.nettogrof.battlesnake.treesearch.search.squad with parameters of type AbstractNode Modifier and Type Method Description AbstractNodeSquadNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)protected SnakeInfoAbstractSquadSearch. createSnakeInfo(SnakeInfo snake, int newHead, AbstractNode currentNode)protected SnakeInfoSquadSearch. createSnakeInfo(SnakeInfo currentSnake, int newHead, AbstractNode node)Constructors in ai.nettogrof.battlesnake.treesearch.search.squad with parameters of type AbstractNode Constructor Description AbstractSquadSearch(AbstractNode root, int width, int height)Constructor used to expand the tree once.AbstractSquadSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search.SquadSearch(AbstractNode root, int width, int height)Constructor used to expand the tree once.SquadSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search. -
Uses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.standard
Subclasses of AbstractNode in ai.nettogrof.battlesnake.treesearch.search.standard Modifier and Type Class Description classDuelNodeThis Duel node class must be use when only 2 snakes left, and in standard mode.classFourNodeThis FourNode class must be use when only 3 or 4 snakes left, and in standard mode.classManyNodeThis ManyNode class must be use when more than 4 snakes left, and in standard mode.Methods in ai.nettogrof.battlesnake.treesearch.search.standard that return AbstractNode Modifier and Type Method Description AbstractNodeDuelNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Uses to create duel nodeAbstractNodeFourNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Uses to create fourNode typeAbstractNodeManyNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Uses to create ManyNode typeMethods in ai.nettogrof.battlesnake.treesearch.search.standard with parameters of type AbstractNode Modifier and Type Method Description AbstractNodeDuelNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Uses to create duel nodeAbstractNodeFourNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Uses to create fourNode typeAbstractNodeManyNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)Uses to create ManyNode typeprotected SnakeInfoAbstractStandardSearch. createSnakeInfo(SnakeInfo snake, int newHead, AbstractNode node)Constructors in ai.nettogrof.battlesnake.treesearch.search.standard with parameters of type AbstractNode Constructor Description AbstractStandardSearch(AbstractNode root, int width, int height)Constructor used to expand the tree once.MctsSearch(AbstractNode root, int width, int height)Constructor used to expand the tree once.MctsSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search.RegularSearch(AbstractNode root, int width, int height)Constructor used to expand the tree once.RegularSearch(AbstractNode root, int width, int height, long starttime, int timeout)Constructor used to expand to do the tree search.
-