package
0.0.0-20250207190657-2f857293acf4
Repository: https://github.com/janpfeifer/hivego.git
Documentation: pkg.go.dev
# Functions
FeatureVector calculates the feature vector, of length BoardFeaturesDim, for the given board.
FullBoardDimensions returns the minimal dimensions required to fit the board.
No description provided by the author
MakeFullBoardFeatures returns features for the full board within an area of height/width.
No description provided by the author
ActionFeatures build the features for one action.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
Total dimension of the feature vector per position.
IdAverageDistanceToQueen represents the average manhattan distance to opposing queen for each of the piece types.
IdMovesToDraw represents the number of moves till a draw due to running out of moves.
IdNumCanMove represent how many pieces can move.
IdNumFeatureIds defined -- this must always be the last enum.
IdNumOffboard represents how many pieces of the player are offboard, per piece type.
IdNumSingle number of pieces that are "leaves" (only one neighbor) First number is for current player, the second is for the opponent.
IdNumSurroundingQueen represents how many pieces are around the queen (0 if queen hasn't been placed).
IdNumThreateningMoves represents the number of moves threatening to reach around opponents queen.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IdQueenCovered represents whether there is an opponent BEETLE on top of QUEEN.
Whether the piece is removable without breaking the hive.
This is the one-hot encoding of the piece on the top of the stack.
+1 for current player, -1 for opponent player or 0 if there are no pieces at this position.
Features Per Position:.
Features Per Position:.
Player owner of the stack pieces (from top to bottom), except very bottom piece.
Value for radius-2.
No description provided by the author
No description provided by the author
# Variables
BoardFeaturesDim is the dimension of all board features concatenated, set during package initialization.
BoardSpecs enumerates in order the features extracted by FeatureVector.
No description provided by the author
No description provided by the author
The 18 radius-2 neighbour positions (given as delta-X and delta-Y), aggregated in groups of 3 that if rotated should be equivalent.
The 18 radius-2 neighbour positions (given as delta-X and delta-Y), aggregated in groups of 3 that if rotated should be equivalent.
# Structs
No description provided by the author
No description provided by the author
BoardSpec includes the board feature name, dimension and index in the concatenation of features.
LabeledExample can be used for training.
PositionSpec includes the position feature name, dimension and index in the concatenation of features.
# Type aliases
BoardId represent an enum of board features.
FeatureSetter is the signature of a feature setter.
PositionId is an enum of position feature ids.