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 AbstractNode
AbstractTreeSearchSnakeAI. lastRoot
Keep 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 AbstractNode
AbstractSearchSnakeAI. checkWinLost(AbstractNode winner, AbstractNode root, Map<String,String> response)
Check if it's a win or lostprotected AbstractNode
AbstractTreeSearchSnakeAI. chooseBestMove(AbstractNode root)
Choose the best move, based on the assumption that the opponent will always choose the best counter.protected AbstractNode
AbstractTreeSearchSnakeAI. 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 AbstractNode
AbstractSearchSnakeAI. finishHim(AbstractNode root, AbstractNode winner)
In a winning position, this method try to find the shortest way to win.protected AbstractNode
AbstractTreeSearchSnakeAI. finishHim(AbstractNode root, AbstractNode winner)
In a winning position, this method try to find the shortest way to win.protected AbstractNode
ExpertSnake. genNode(List<SnakeInfo> snakes, FoodInfo food, HazardSquare hazard)
This method generate the root node typeprotected abstract AbstractNode
AbstractTreeSearchSnakeAI. genRoot(com.fasterxml.jackson.databind.JsonNode moveRequest)
Generate the root node based on the /move requestprotected AbstractNode
ExpertSnake. genRoot(com.fasterxml.jackson.databind.JsonNode moveRequest)
Generate the root node based on the /move requestprotected abstract AbstractNode
AbstractSearchSnakeAI. lastChance(AbstractNode root)
In a losing position, this method try to find the longest way, hpoing that the opponent make a mistake.protected AbstractNode
AbstractTreeSearchSnakeAI. 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 AbstractNode
AbstractSearchSnakeAI. checkWinLost(AbstractNode winner, AbstractNode root, Map<String,String> response)
Check if it's a win or lostprotected AbstractNode
AbstractTreeSearchSnakeAI. chooseBestMove(AbstractNode root)
Choose the best move, based on the assumption that the opponent will always choose the best counter.private void
AbstractTreeSearchSnakeAI. 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 AbstractNode
AbstractSearchSnakeAI. finishHim(AbstractNode root, AbstractNode winner)
In a winning position, this method try to find the shortest way to win.protected AbstractNode
AbstractTreeSearchSnakeAI. 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 int
AbstractTreeSearchSnakeAI. getMaxDepth(AbstractNode root)
Check the depth of the biggest branchprotected abstract AbstractNode
AbstractSearchSnakeAI. lastChance(AbstractNode root)
In a losing position, this method try to find the longest way, hpoing that the opponent make a mistake.protected AbstractNode
AbstractTreeSearchSnakeAI. lastChance(AbstractNode root)
In a losing position, this method try to find the longest way, hpoing that the opponent make a mistake.protected void
AbstractMultiThreadSnakeAI. multiThreadtreeSearch(AbstractNode root, Long startTime, GameRuleset rules)
Execute the multiThread tree searchvoid
AbstractTreeSearchSnakeAI. singleThreadTreeSearch(AbstractNode root, Long startTime, GameRuleset rules)
Execute the single Thread tree searchprotected void
AbstractMultiThreadSnakeAI. treeSearch(AbstractNode root, Long startTime, GameRuleset rules)
Execute the tree searchprotected void
AbstractTreeSearchSnakeAI. 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 void
AbstractMultiThreadSnakeAI. 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 AbstractNode
AbstractSearch. root
Root node for the searchMethods in ai.nettogrof.battlesnake.treesearch that return AbstractNode Modifier and Type Method Description AbstractNode
AbstractBestFirstSearch. getBestChild(AbstractNode node)
This method find and return the best leaf nodeprotected AbstractNode
AbstractSearch. getSmallestChild(AbstractNode node)
Get the leaf from the smallest branchprivate AbstractNode
AbstractBestFirstSearch. 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 void
AbstractSearch. 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 SnakeInfo
AbstractSearch. createSnakeInfo(SnakeInfo snakeInfo, int newHead, AbstractNode node)
Create new SnakeInfo based on the current node and the new head squareprivate void
AbstractBestFirstSearch. 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 void
AbstractMCTS. 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 void
AbstractSearch. 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.AbstractNode
AbstractBestFirstSearch. 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 AbstractNode
AbstractSearch. getSmallestChild(AbstractNode node)
Get the leaf from the smallest branchprivate AbstractNode
AbstractBestFirstSearch. getWinnerChild(AbstractNode node)
Get the best child/winner from a nodeprivate float
AbstractMCTS. mctsScore(AbstractNode parentNode, AbstractNode childNode)
Calculation of the Upper Confident Bound score.protected void
AbstractSearch. 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 void
AbstractBestFirstSearch. mergeList(List<AbstractNode> tree, List<AbstractNode> branch)
This method just merge two lists and remove the duplicate nodeprotected void
AbstractBestFirstSearch. 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 class
AbstractDecisionNode
This abstract node class is the based of all node class, provide basic update Score Currently using Paranoid only, I hope to add MaxN soonclass
AbstractEvaluationNode
This 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. child
List of child nodeMethods in ai.nettogrof.battlesnake.treesearch.node that return AbstractNode Modifier and Type Method Description abstract AbstractNode
AbstractNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Create a node from the same typestatic AbstractNode
NodeUtil. getBestNode(AbstractNode node)
Get the best childstatic AbstractNode
NodeUtil. 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 void
AbstractNode. addChild(AbstractNode newChild)
Add a child to this nodeabstract AbstractNode
AbstractNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Create a node from the same typestatic AbstractNode
NodeUtil. getBestNode(AbstractNode node)
Get the best childstatic AbstractNode
NodeUtil. 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 class
ConstrictorNode
This 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 AbstractNode
ConstrictorNode. 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 AbstractNode
ConstrictorNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Uses to create constrictor nodeprotected SnakeInfo
ConstrictorSearch. 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 SnakeInfo
LimitedMoveRoyaleSearch. 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 void
LimitedMoveRoyaleSearch. 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 class
AbstractRoyaleNode
This abstract royale node class is the based of all node class, provide basic method use in any node for royale rules.class
RoyaleDuelNode
This Royale Duel node class must be use when only 2 snakes left, and in royale mode.class
RoyaleFourNode
This 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 AbstractNode
RoyaleDuelNode. createNode(List<SnakeInfo> snakeInfo, AbstractNode currentNode)
Uses to create royale duel nodeAbstractNode
RoyaleFourNode. 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 AbstractNode
RoyaleDuelNode. createNode(List<SnakeInfo> snakeInfo, AbstractNode currentNode)
Uses to create royale duel nodeAbstractNode
RoyaleFourNode. createNode(List<SnakeInfo> snakeInfo, AbstractNode currentNode)
Uses to create fourNode typeprotected SnakeInfo
AbstractRoyaleSearch. 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 class
WrappedRoyaleNode
This 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 AbstractNode
WrappedRoyaleNode. 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 AbstractNode
WrappedRoyaleNode. 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 class
SquadNode
This Squad node class must be in squad modeMethods in ai.nettogrof.battlesnake.treesearch.search.squad that return AbstractNode Modifier and Type Method Description AbstractNode
SquadNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Methods in ai.nettogrof.battlesnake.treesearch.search.squad with parameters of type AbstractNode Modifier and Type Method Description AbstractNode
SquadNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
protected SnakeInfo
AbstractSquadSearch. createSnakeInfo(SnakeInfo snake, int newHead, AbstractNode currentNode)
protected SnakeInfo
SquadSearch. 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 class
DuelNode
This Duel node class must be use when only 2 snakes left, and in standard mode.class
FourNode
This FourNode class must be use when only 3 or 4 snakes left, and in standard mode.class
ManyNode
This 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 AbstractNode
DuelNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Uses to create duel nodeAbstractNode
FourNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Uses to create fourNode typeAbstractNode
ManyNode. 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 AbstractNode
DuelNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Uses to create duel nodeAbstractNode
FourNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Uses to create fourNode typeAbstractNode
ManyNode. createNode(List<SnakeInfo> snakes, AbstractNode currentNode)
Uses to create ManyNode typeprotected SnakeInfo
AbstractStandardSearch. 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.
-