Class AbstractStandardSearch
- java.lang.Object
-
- ai.nettogrof.battlesnake.treesearch.AbstractSearch
-
- ai.nettogrof.battlesnake.treesearch.AbstractBestFirstSearch
-
- ai.nettogrof.battlesnake.treesearch.AbstractMCTS
-
- ai.nettogrof.battlesnake.treesearch.search.standard.AbstractStandardSearch
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
MctsSearch,RegularSearch
public abstract class AbstractStandardSearch extends AbstractMCTS
This abstract Standard search, provide basic method use in any search in battlesnake standard mode- Version:
- Spring 2021
- Author:
- carl.lajeunesse
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractStandardSearch()Basic constructorprotectedAbstractStandardSearch(AbstractNode root, int width, int height)Constructor used to expand the tree once.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SnakeInfocreateSnakeInfo(SnakeInfo snake, int newHead, AbstractNode node)Create new SnakeInfo based on the current node and the new head squareprotected booleanfreeSpace(int square, List<SnakeInfo> snakes, SnakeInfo yourSnake)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
-
AbstractStandardSearch
protected AbstractStandardSearch()
Basic constructor
-
AbstractStandardSearch
protected AbstractStandardSearch(AbstractNode root, int width, int height)
Constructor used to expand the tree once.- Parameters:
root- Root nodewidth- Board widthheight- Board height
-
-
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 node)
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 squarenode- Previous node- Returns:
- new SnakeInfo
-
freeSpace
protected boolean freeSpace(int square, List<SnakeInfo> snakes, SnakeInfo yourSnake)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 snakesyourSnake- current Snake- Returns:
- boolean free to move on that square
-
-