Class AbstractRoyaleSearch
- java.lang.Object
-
- ai.nettogrof.battlesnake.treesearch.AbstractSearch
-
- ai.nettogrof.battlesnake.treesearch.AbstractBestFirstSearch
-
- ai.nettogrof.battlesnake.treesearch.AbstractMCTS
-
- ai.nettogrof.battlesnake.treesearch.search.royale.AbstractRoyaleSearch
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
LimitedMoveRoyaleSearch,RoyaleSearch,WrappedRoyaleSearch
public abstract class AbstractRoyaleSearch extends AbstractMCTS
This abstract Royale search, provide basic method use in any search in battlesnake royale mode- Version:
- Spring 2021
- Author:
- carl.lajeunesse
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRoyaleSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)Constructor used to expand to do the tree search.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SnakeInfocreateSnakeInfo(SnakeInfo snake, int newHead, AbstractNode currentNode)Create new SnakeInfo based on the current node and the new head squareprotected booleanfreeSpace(int square, List<SnakeInfo> snakes, SnakeInfo currentSnake)Check if the snake can move on the squareprotected voidkill(SnakeInfo death, List<SnakeInfo> all)This abstract method will be use to "kill" a snake-
Methods inherited from class ai.nettogrof.battlesnake.treesearch.AbstractMCTS
executeMCTS, getMCTSBestPath
-
Methods inherited from class ai.nettogrof.battlesnake.treesearch.AbstractBestFirstSearch
getBestChild, getbestChildValue, getBestPath, mergeList, updateFullListNode, updateListNode
-
Methods inherited from class ai.nettogrof.battlesnake.treesearch.AbstractSearch
addMove, checkHeadToHead, generateChild, generateChild, generateSnakeInfoDestination, getSmallestChild, merge, moveSnake, stopSearching
-
-
-
-
Constructor Detail
-
AbstractRoyaleSearch
protected AbstractRoyaleSearch(AbstractNode root, int width, int height, long starttime, int timeout, GameRuleset rules)
Constructor used to expand to do the tree search.- Parameters:
root- Root nodewidth- Board widthheight- Board heightstarttime- starting time for the search in millisecondtimeout- the time limit to run the searchrules- the game ruleset info
-
-
Method Detail
-
kill
protected void kill(SnakeInfo death, List<SnakeInfo> all)
Description copied from class:AbstractSearchThis abstract method will be use to "kill" a snake- Specified by:
killin classAbstractSearch- Parameters:
death- SnakeInfo of the snake to killall- List of all snakeinfo
-
createSnakeInfo
protected SnakeInfo createSnakeInfo(SnakeInfo snake, int newHead, AbstractNode currentNode)
Description copied from class:AbstractSearchCreate new SnakeInfo based on the current node and the new head square- Specified by:
createSnakeInfoin classAbstractSearch- Parameters:
snake- previous snakeInfonewHead- New head squarecurrentNode- Previous node- Returns:
- new SnakeInfo
-
freeSpace
protected boolean freeSpace(int square, List<SnakeInfo> snakes, SnakeInfo currentSnake)Description copied from class:AbstractSearchCheck if the snake can move on the square- Specified by:
freeSpacein classAbstractSearch- Parameters:
square- the int sqauresnakes- List of all snakescurrentSnake- current Snake- Returns:
- boolean free to move on that square
-
-