hexzpb

package
v0.0.0-...-3e36cfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Board_GameState_name = map[int32]string{
		0: "INITIAL",
		1: "RUNNING",
		2: "FINISHED",
	}
	Board_GameState_value = map[string]int32{
		"INITIAL":  0,
		"RUNNING":  1,
		"FINISHED": 2,
	}
)

Enum value maps for Board_GameState.

View Source
var (
	Field_CellType_name = map[int32]string{
		0: "NORMAL",
		1: "DEAD",
		2: "GRASS",
		3: "ROCK",
		4: "FIRE",
		5: "FLAG",
		6: "PEST",
		7: "DEATH",
	}
	Field_CellType_value = map[string]int32{
		"NORMAL": 0,
		"DEAD":   1,
		"GRASS":  2,
		"ROCK":   3,
		"FIRE":   4,
		"FLAG":   5,
		"PEST":   6,
		"DEATH":  7,
	}
)

Enum value maps for Field_CellType.

View Source
var (
	SuggestMoveStats_ScoreKind_name = map[int32]string{
		0: "FINAL",
		1: "MCTS_PRIOR",
	}
	SuggestMoveStats_ScoreKind_value = map[string]int32{
		"FINAL":      0,
		"MCTS_PRIOR": 1,
	}
)

Enum value maps for SuggestMoveStats_ScoreKind.

View Source
var (
	AddTrainingExamplesResponse_Status_name = map[int32]string{
		0: "STATUS_UNSPECIFIED",
		1: "ACCEPTED",
		2: "REJECTED_WRONG_MODEL",
		3: "REJECTED_AT_CAPACITY",
		4: "REJECTED_OTHER",
	}
	AddTrainingExamplesResponse_Status_value = map[string]int32{
		"STATUS_UNSPECIFIED":   0,
		"ACCEPTED":             1,
		"REJECTED_WRONG_MODEL": 2,
		"REJECTED_AT_CAPACITY": 3,
		"REJECTED_OTHER":       4,
	}
)

Enum value maps for AddTrainingExamplesResponse_Status.

View Source
var (
	TrainingExample_Encoding_name = map[int32]string{
		0: "NUMPY",
		1: "PYTORCH",
	}
	TrainingExample_Encoding_value = map[string]int32{
		"NUMPY":   0,
		"PYTORCH": 1,
	}
)

Enum value maps for TrainingExample_Encoding.

View Source
var File_hexzpb_hexz_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AddTrainingExamplesRequest

type AddTrainingExamplesRequest struct {
	Examples []*TrainingExample `protobuf:"bytes,1,rep,name=examples,proto3" json:"examples,omitempty"`
	// ID identifying the worker run that generated this example.
	// Typically a random UUID.
	ExecutionId string `protobuf:"bytes,2,opt,name=execution_id,json=executionId,proto3" json:"execution_id,omitempty"`
	// contains filtered or unexported fields
}

Used by workers to upload examples to the training server.

func (*AddTrainingExamplesRequest) Descriptor deprecated

func (*AddTrainingExamplesRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddTrainingExamplesRequest.ProtoReflect.Descriptor instead.

func (*AddTrainingExamplesRequest) GetExamples

func (x *AddTrainingExamplesRequest) GetExamples() []*TrainingExample

func (*AddTrainingExamplesRequest) GetExecutionId

func (x *AddTrainingExamplesRequest) GetExecutionId() string

func (*AddTrainingExamplesRequest) ProtoMessage

func (*AddTrainingExamplesRequest) ProtoMessage()

func (*AddTrainingExamplesRequest) ProtoReflect

func (*AddTrainingExamplesRequest) Reset

func (x *AddTrainingExamplesRequest) Reset()

func (*AddTrainingExamplesRequest) String

func (x *AddTrainingExamplesRequest) String() string

type AddTrainingExamplesResponse

type AddTrainingExamplesResponse struct {
	Status AddTrainingExamplesResponse_Status `protobuf:"varint,1,opt,name=status,proto3,enum=hexzpb.AddTrainingExamplesResponse_Status" json:"status,omitempty"`
	// Tells the worker which model to use for subsequent requests.
	LatestModel *ModelKey `protobuf:"bytes,2,opt,name=latest_model,json=latestModel,proto3" json:"latest_model,omitempty"`
	// Populated if there was an error processing the request.
	ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
	// contains filtered or unexported fields
}

func (*AddTrainingExamplesResponse) Descriptor deprecated

func (*AddTrainingExamplesResponse) Descriptor() ([]byte, []int)

Deprecated: Use AddTrainingExamplesResponse.ProtoReflect.Descriptor instead.

func (*AddTrainingExamplesResponse) GetErrorMessage

func (x *AddTrainingExamplesResponse) GetErrorMessage() string

func (*AddTrainingExamplesResponse) GetLatestModel

func (x *AddTrainingExamplesResponse) GetLatestModel() *ModelKey

func (*AddTrainingExamplesResponse) GetStatus

func (*AddTrainingExamplesResponse) ProtoMessage

func (*AddTrainingExamplesResponse) ProtoMessage()

func (*AddTrainingExamplesResponse) ProtoReflect

func (*AddTrainingExamplesResponse) Reset

func (x *AddTrainingExamplesResponse) Reset()

func (*AddTrainingExamplesResponse) String

func (x *AddTrainingExamplesResponse) String() string

type AddTrainingExamplesResponse_Status

type AddTrainingExamplesResponse_Status int32
const (
	AddTrainingExamplesResponse_STATUS_UNSPECIFIED   AddTrainingExamplesResponse_Status = 0
	AddTrainingExamplesResponse_ACCEPTED             AddTrainingExamplesResponse_Status = 1
	AddTrainingExamplesResponse_REJECTED_WRONG_MODEL AddTrainingExamplesResponse_Status = 2
	AddTrainingExamplesResponse_REJECTED_AT_CAPACITY AddTrainingExamplesResponse_Status = 3
	AddTrainingExamplesResponse_REJECTED_OTHER       AddTrainingExamplesResponse_Status = 4
)

func (AddTrainingExamplesResponse_Status) Descriptor

func (AddTrainingExamplesResponse_Status) Enum

func (AddTrainingExamplesResponse_Status) EnumDescriptor deprecated

func (AddTrainingExamplesResponse_Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use AddTrainingExamplesResponse_Status.Descriptor instead.

func (AddTrainingExamplesResponse_Status) Number

func (AddTrainingExamplesResponse_Status) String

func (AddTrainingExamplesResponse_Status) Type

type Board

type Board struct {
	Turn         int32           `protobuf:"varint,1,opt,name=turn,proto3" json:"turn,omitempty"`
	Move         int32           `protobuf:"varint,2,opt,name=move,proto3" json:"move,omitempty"`
	LastRevealed int32           `protobuf:"varint,3,opt,name=last_revealed,json=lastRevealed,proto3" json:"last_revealed,omitempty"`
	FlatFields   []*Field        `protobuf:"bytes,4,rep,name=flat_fields,json=flatFields,proto3" json:"flat_fields,omitempty"`
	Score        []int32         `protobuf:"varint,5,rep,packed,name=score,proto3" json:"score,omitempty"`
	Resources    []*ResourceInfo `protobuf:"bytes,6,rep,name=resources,proto3" json:"resources,omitempty"`
	State        Board_GameState `protobuf:"varint,7,opt,name=state,proto3,enum=hexzpb.Board_GameState" json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*Board) Descriptor deprecated

func (*Board) Descriptor() ([]byte, []int)

Deprecated: Use Board.ProtoReflect.Descriptor instead.

func (*Board) GetFlatFields

func (x *Board) GetFlatFields() []*Field

func (*Board) GetLastRevealed

func (x *Board) GetLastRevealed() int32

func (*Board) GetMove

func (x *Board) GetMove() int32

func (*Board) GetResources

func (x *Board) GetResources() []*ResourceInfo

func (*Board) GetScore

func (x *Board) GetScore() []int32

func (*Board) GetState

func (x *Board) GetState() Board_GameState

func (*Board) GetTurn

func (x *Board) GetTurn() int32

func (*Board) ProtoMessage

func (*Board) ProtoMessage()

func (*Board) ProtoReflect

func (x *Board) ProtoReflect() protoreflect.Message

func (*Board) Reset

func (x *Board) Reset()

func (*Board) String

func (x *Board) String() string

type Board_GameState

type Board_GameState int32
const (
	Board_INITIAL  Board_GameState = 0
	Board_RUNNING  Board_GameState = 1
	Board_FINISHED Board_GameState = 2
)

func (Board_GameState) Descriptor

func (Board_GameState) Enum

func (x Board_GameState) Enum() *Board_GameState

func (Board_GameState) EnumDescriptor deprecated

func (Board_GameState) EnumDescriptor() ([]byte, []int)

Deprecated: Use Board_GameState.Descriptor instead.

func (Board_GameState) Number

func (Board_GameState) String

func (x Board_GameState) String() string

func (Board_GameState) Type

type Field

type Field struct {
	Type     Field_CellType `protobuf:"varint,1,opt,name=type,proto3,enum=hexzpb.Field_CellType" json:"type,omitempty"`
	Owner    int32          `protobuf:"varint,2,opt,name=owner,proto3" json:"owner,omitempty"`
	Hidden   bool           `protobuf:"varint,3,opt,name=hidden,proto3" json:"hidden,omitempty"`
	Value    int32          `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"`
	Blocked  int32          `protobuf:"varint,5,opt,name=blocked,proto3" json:"blocked,omitempty"`
	Lifetime int32          `protobuf:"varint,6,opt,name=lifetime,proto3" json:"lifetime,omitempty"`
	NextVal  []int32        `protobuf:"varint,7,rep,packed,name=next_val,json=nextVal,proto3" json:"next_val,omitempty"`
	// contains filtered or unexported fields
}

func (*Field) Descriptor deprecated

func (*Field) Descriptor() ([]byte, []int)

Deprecated: Use Field.ProtoReflect.Descriptor instead.

func (*Field) GetBlocked

func (x *Field) GetBlocked() int32

func (*Field) GetHidden

func (x *Field) GetHidden() bool

func (*Field) GetLifetime

func (x *Field) GetLifetime() int32

func (*Field) GetNextVal

func (x *Field) GetNextVal() []int32

func (*Field) GetOwner

func (x *Field) GetOwner() int32

func (*Field) GetType

func (x *Field) GetType() Field_CellType

func (*Field) GetValue

func (x *Field) GetValue() int32

func (*Field) ProtoMessage

func (*Field) ProtoMessage()

func (*Field) ProtoReflect

func (x *Field) ProtoReflect() protoreflect.Message

func (*Field) Reset

func (x *Field) Reset()

func (*Field) String

func (x *Field) String() string

type Field_CellType

type Field_CellType int32
const (
	Field_NORMAL Field_CellType = 0
	Field_DEAD   Field_CellType = 1
	Field_GRASS  Field_CellType = 2
	Field_ROCK   Field_CellType = 3
	Field_FIRE   Field_CellType = 4
	Field_FLAG   Field_CellType = 5
	Field_PEST   Field_CellType = 6
	Field_DEATH  Field_CellType = 7
)

func (Field_CellType) Descriptor

func (Field_CellType) Enum

func (x Field_CellType) Enum() *Field_CellType

func (Field_CellType) EnumDescriptor deprecated

func (Field_CellType) EnumDescriptor() ([]byte, []int)

Deprecated: Use Field_CellType.Descriptor instead.

func (Field_CellType) Number

func (Field_CellType) String

func (x Field_CellType) String() string

func (Field_CellType) Type

type GameEngineClassicState

type GameEngineClassicState struct {
	Board *Board `protobuf:"bytes,1,opt,name=board,proto3" json:"board,omitempty"`
	// contains filtered or unexported fields
}

The encoded state of a GameEngineClassic. Used for saving and loading games.

func (*GameEngineClassicState) Descriptor deprecated

func (*GameEngineClassicState) Descriptor() ([]byte, []int)

Deprecated: Use GameEngineClassicState.ProtoReflect.Descriptor instead.

func (*GameEngineClassicState) GetBoard

func (x *GameEngineClassicState) GetBoard() *Board

func (*GameEngineClassicState) ProtoMessage

func (*GameEngineClassicState) ProtoMessage()

func (*GameEngineClassicState) ProtoReflect

func (x *GameEngineClassicState) ProtoReflect() protoreflect.Message

func (*GameEngineClassicState) Reset

func (x *GameEngineClassicState) Reset()

func (*GameEngineClassicState) String

func (x *GameEngineClassicState) String() string

type GameEngineFlagzState

type GameEngineFlagzState struct {
	Board     *Board `protobuf:"bytes,1,opt,name=board,proto3" json:"board,omitempty"`
	FreeCells int32  `protobuf:"varint,2,opt,name=free_cells,json=freeCells,proto3" json:"free_cells,omitempty"`
	// Always exactly two elements, one per player.
	NormalMoves []int32 `protobuf:"varint,3,rep,packed,name=normal_moves,json=normalMoves,proto3" json:"normal_moves,omitempty"`
	// History of moves made so far.
	Moves []*GameEngineMove `protobuf:"bytes,4,rep,name=moves,proto3" json:"moves,omitempty"`
	// contains filtered or unexported fields
}

The encoded state of a GameEngineFlagz. Used for saving and loading games.

func (*GameEngineFlagzState) Descriptor deprecated

func (*GameEngineFlagzState) Descriptor() ([]byte, []int)

Deprecated: Use GameEngineFlagzState.ProtoReflect.Descriptor instead.

func (*GameEngineFlagzState) GetBoard

func (x *GameEngineFlagzState) GetBoard() *Board

func (*GameEngineFlagzState) GetFreeCells

func (x *GameEngineFlagzState) GetFreeCells() int32

func (*GameEngineFlagzState) GetMoves

func (x *GameEngineFlagzState) GetMoves() []*GameEngineMove

func (*GameEngineFlagzState) GetNormalMoves

func (x *GameEngineFlagzState) GetNormalMoves() []int32

func (*GameEngineFlagzState) ProtoMessage

func (*GameEngineFlagzState) ProtoMessage()

func (*GameEngineFlagzState) ProtoReflect

func (x *GameEngineFlagzState) ProtoReflect() protoreflect.Message

func (*GameEngineFlagzState) Reset

func (x *GameEngineFlagzState) Reset()

func (*GameEngineFlagzState) String

func (x *GameEngineFlagzState) String() string

type GameEngineFreeformState

type GameEngineFreeformState struct {
	Board *Board `protobuf:"bytes,1,opt,name=board,proto3" json:"board,omitempty"`
	// contains filtered or unexported fields
}

The encoded state of a GameEngineFreeform. Used for saving and loading games.

func (*GameEngineFreeformState) Descriptor deprecated

func (*GameEngineFreeformState) Descriptor() ([]byte, []int)

Deprecated: Use GameEngineFreeformState.ProtoReflect.Descriptor instead.

func (*GameEngineFreeformState) GetBoard

func (x *GameEngineFreeformState) GetBoard() *Board

func (*GameEngineFreeformState) ProtoMessage

func (*GameEngineFreeformState) ProtoMessage()

func (*GameEngineFreeformState) ProtoReflect

func (x *GameEngineFreeformState) ProtoReflect() protoreflect.Message

func (*GameEngineFreeformState) Reset

func (x *GameEngineFreeformState) Reset()

func (*GameEngineFreeformState) String

func (x *GameEngineFreeformState) String() string

type GameEngineMove

type GameEngineMove struct {
	PlayerNum int32          `protobuf:"varint,1,opt,name=player_num,json=playerNum,proto3" json:"player_num,omitempty"`
	Move      int32          `protobuf:"varint,2,opt,name=move,proto3" json:"move,omitempty"`
	Row       int32          `protobuf:"varint,3,opt,name=row,proto3" json:"row,omitempty"`
	Col       int32          `protobuf:"varint,4,opt,name=col,proto3" json:"col,omitempty"`
	CellType  Field_CellType `protobuf:"varint,5,opt,name=cell_type,json=cellType,proto3,enum=hexzpb.Field_CellType" json:"cell_type,omitempty"`
	// contains filtered or unexported fields
}

func (*GameEngineMove) Descriptor deprecated

func (*GameEngineMove) Descriptor() ([]byte, []int)

Deprecated: Use GameEngineMove.ProtoReflect.Descriptor instead.

func (*GameEngineMove) GetCellType

func (x *GameEngineMove) GetCellType() Field_CellType

func (*GameEngineMove) GetCol

func (x *GameEngineMove) GetCol() int32

func (*GameEngineMove) GetMove

func (x *GameEngineMove) GetMove() int32

func (*GameEngineMove) GetPlayerNum

func (x *GameEngineMove) GetPlayerNum() int32

func (*GameEngineMove) GetRow

func (x *GameEngineMove) GetRow() int32

func (*GameEngineMove) ProtoMessage

func (*GameEngineMove) ProtoMessage()

func (*GameEngineMove) ProtoReflect

func (x *GameEngineMove) ProtoReflect() protoreflect.Message

func (*GameEngineMove) Reset

func (x *GameEngineMove) Reset()

func (*GameEngineMove) String

func (x *GameEngineMove) String() string

type GameEngineState

type GameEngineState struct {

	// Types that are assignable to State:
	//
	//	*GameEngineState_Flagz
	//	*GameEngineState_Classic
	//	*GameEngineState_Freeform
	State isGameEngineState_State `protobuf_oneof:"state"`
	// contains filtered or unexported fields
}

This message contains all data to restore a game engine state. Every GameEngine implementation implements the .Encode() method to encode its state into this message.

func (*GameEngineState) Descriptor deprecated

func (*GameEngineState) Descriptor() ([]byte, []int)

Deprecated: Use GameEngineState.ProtoReflect.Descriptor instead.

func (*GameEngineState) GetClassic

func (x *GameEngineState) GetClassic() *GameEngineClassicState

func (*GameEngineState) GetFlagz

func (x *GameEngineState) GetFlagz() *GameEngineFlagzState

func (*GameEngineState) GetFreeform

func (x *GameEngineState) GetFreeform() *GameEngineFreeformState

func (*GameEngineState) GetState

func (m *GameEngineState) GetState() isGameEngineState_State

func (*GameEngineState) ProtoMessage

func (*GameEngineState) ProtoMessage()

func (*GameEngineState) ProtoReflect

func (x *GameEngineState) ProtoReflect() protoreflect.Message

func (*GameEngineState) Reset

func (x *GameEngineState) Reset()

func (*GameEngineState) String

func (x *GameEngineState) String() string

type GameEngineState_Classic

type GameEngineState_Classic struct {
	Classic *GameEngineClassicState `protobuf:"bytes,2,opt,name=classic,proto3,oneof"`
}

type GameEngineState_Flagz

type GameEngineState_Flagz struct {
	// All game engine types should have one field in this oneof.
	Flagz *GameEngineFlagzState `protobuf:"bytes,1,opt,name=flagz,proto3,oneof"`
}

type GameEngineState_Freeform

type GameEngineState_Freeform struct {
	Freeform *GameEngineFreeformState `protobuf:"bytes,3,opt,name=freeform,proto3,oneof"`
}

type GameInfo

type GameInfo struct {
	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Host      string                 `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` // The player hosting the game.
	Started   *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=started,proto3" json:"started,omitempty"`
	Type      string                 `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`                             // Expected to match a hexz.GameType value.
	CpuPlayer bool                   `protobuf:"varint,5,opt,name=cpu_player,json=cpuPlayer,proto3" json:"cpu_player,omitempty"` // True if this is a single player game against a CPU player.
	// contains filtered or unexported fields
}

GameInfo is summary information about an ongoing game, used to display a list of games to the user.

func (*GameInfo) Descriptor deprecated

func (*GameInfo) Descriptor() ([]byte, []int)

Deprecated: Use GameInfo.ProtoReflect.Descriptor instead.

func (*GameInfo) GetCpuPlayer

func (x *GameInfo) GetCpuPlayer() bool

func (*GameInfo) GetHost

func (x *GameInfo) GetHost() string

func (*GameInfo) GetId

func (x *GameInfo) GetId() string

func (*GameInfo) GetStarted

func (x *GameInfo) GetStarted() *timestamppb.Timestamp

func (*GameInfo) GetType

func (x *GameInfo) GetType() string

func (*GameInfo) ProtoMessage

func (*GameInfo) ProtoMessage()

func (*GameInfo) ProtoReflect

func (x *GameInfo) ProtoReflect() protoreflect.Message

func (*GameInfo) Reset

func (x *GameInfo) Reset()

func (*GameInfo) String

func (x *GameInfo) String() string

type GameState

type GameState struct {
	GameInfo *GameInfo              `protobuf:"bytes,1,opt,name=game_info,json=gameInfo,proto3" json:"game_info,omitempty"`
	Seqnum   int64                  `protobuf:"varint,2,opt,name=seqnum,proto3" json:"seqnum,omitempty"`
	Modified *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=modified,proto3" json:"modified,omitempty"`
	// Players in this game, in the order they joined.
	Players     []*Player        `protobuf:"bytes,5,rep,name=players,proto3" json:"players,omitempty"`
	EngineState *GameEngineState `protobuf:"bytes,6,opt,name=engine_state,json=engineState,proto3" json:"engine_state,omitempty"`
	// contains filtered or unexported fields
}

This message contains all data to restore a game state. It can be used to save and load games in a memory store.

func (*GameState) Descriptor deprecated

func (*GameState) Descriptor() ([]byte, []int)

Deprecated: Use GameState.ProtoReflect.Descriptor instead.

func (*GameState) GetEngineState

func (x *GameState) GetEngineState() *GameEngineState

func (*GameState) GetGameInfo

func (x *GameState) GetGameInfo() *GameInfo

func (*GameState) GetModified

func (x *GameState) GetModified() *timestamppb.Timestamp

func (*GameState) GetPlayers

func (x *GameState) GetPlayers() []*Player

func (*GameState) GetSeqnum

func (x *GameState) GetSeqnum() int64

func (*GameState) PlayerNames

func (s *GameState) PlayerNames() []string

func (*GameState) PlayerNum

func (s *GameState) PlayerNum(playerId string) int

func (*GameState) ProtoMessage

func (*GameState) ProtoMessage()

func (*GameState) ProtoReflect

func (x *GameState) ProtoReflect() protoreflect.Message

func (*GameState) Reset

func (x *GameState) Reset()

func (*GameState) String

func (x *GameState) String() string

type MCTSExample

type MCTSExample struct {
	GameId string `protobuf:"bytes,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"`
	// The board, at any step in a fully played game.
	Board *Board `protobuf:"bytes,2,opt,name=board,proto3" json:"board,omitempty"`
	// The "value", i.e. the final result of the game. Always has two elements.
	Result    []int32                  `protobuf:"varint,3,rep,packed,name=result,proto3" json:"result,omitempty"`
	MoveStats []*MCTSExample_MoveStats `protobuf:"bytes,4,rep,name=move_stats,json=moveStats,proto3" json:"move_stats,omitempty"`
	// contains filtered or unexported fields
}

MCTSExample encodes all data that is necessary to generate a training example for the NeuraMCTS model. Normally, examples would be saved as HDF5 files, but to be facilitate the generation of examples in our highly optimized Go implementation, we use this message format instead. Python code can transform this into HDF5 files.

func (*MCTSExample) Descriptor deprecated

func (*MCTSExample) Descriptor() ([]byte, []int)

Deprecated: Use MCTSExample.ProtoReflect.Descriptor instead.

func (*MCTSExample) GetBoard

func (x *MCTSExample) GetBoard() *Board

func (*MCTSExample) GetGameId

func (x *MCTSExample) GetGameId() string

func (*MCTSExample) GetMoveStats

func (x *MCTSExample) GetMoveStats() []*MCTSExample_MoveStats

func (*MCTSExample) GetResult

func (x *MCTSExample) GetResult() []int32

func (*MCTSExample) ProtoMessage

func (*MCTSExample) ProtoMessage()

func (*MCTSExample) ProtoReflect

func (x *MCTSExample) ProtoReflect() protoreflect.Message

func (*MCTSExample) Reset

func (x *MCTSExample) Reset()

func (*MCTSExample) String

func (x *MCTSExample) String() string

type MCTSExample_MoveStats

type MCTSExample_MoveStats struct {
	Move    *GameEngineMove `protobuf:"bytes,1,opt,name=move,proto3" json:"move,omitempty"`
	Visits  int32           `protobuf:"varint,2,opt,name=visits,proto3" json:"visits,omitempty"`
	WinRate float32         `protobuf:"fixed32,3,opt,name=win_rate,json=winRate,proto3" json:"win_rate,omitempty"`
	// contains filtered or unexported fields
}

The learnt "policy", i.e. the MCTS visit counts and win rates for each move.

func (*MCTSExample_MoveStats) Descriptor deprecated

func (*MCTSExample_MoveStats) Descriptor() ([]byte, []int)

Deprecated: Use MCTSExample_MoveStats.ProtoReflect.Descriptor instead.

func (*MCTSExample_MoveStats) GetMove

func (x *MCTSExample_MoveStats) GetMove() *GameEngineMove

func (*MCTSExample_MoveStats) GetVisits

func (x *MCTSExample_MoveStats) GetVisits() int32

func (*MCTSExample_MoveStats) GetWinRate

func (x *MCTSExample_MoveStats) GetWinRate() float32

func (*MCTSExample_MoveStats) ProtoMessage

func (*MCTSExample_MoveStats) ProtoMessage()

func (*MCTSExample_MoveStats) ProtoReflect

func (x *MCTSExample_MoveStats) ProtoReflect() protoreflect.Message

func (*MCTSExample_MoveStats) Reset

func (x *MCTSExample_MoveStats) Reset()

func (*MCTSExample_MoveStats) String

func (x *MCTSExample_MoveStats) String() string

type ModelKey

type ModelKey struct {
	Name       string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Checkpoint int32  `protobuf:"varint,2,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
	// contains filtered or unexported fields
}

func (*ModelKey) Descriptor deprecated

func (*ModelKey) Descriptor() ([]byte, []int)

Deprecated: Use ModelKey.ProtoReflect.Descriptor instead.

func (*ModelKey) GetCheckpoint

func (x *ModelKey) GetCheckpoint() int32

func (*ModelKey) GetName

func (x *ModelKey) GetName() string

func (*ModelKey) ProtoMessage

func (*ModelKey) ProtoMessage()

func (*ModelKey) ProtoReflect

func (x *ModelKey) ProtoReflect() protoreflect.Message

func (*ModelKey) Reset

func (x *ModelKey) Reset()

func (*ModelKey) String

func (x *ModelKey) String() string

type Player

type Player struct {
	Id   string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Player) Descriptor deprecated

func (*Player) Descriptor() ([]byte, []int)

Deprecated: Use Player.ProtoReflect.Descriptor instead.

func (*Player) GetId

func (x *Player) GetId() string

func (*Player) GetName

func (x *Player) GetName() string

func (*Player) ProtoMessage

func (*Player) ProtoMessage()

func (*Player) ProtoReflect

func (x *Player) ProtoReflect() protoreflect.Message

func (*Player) Reset

func (x *Player) Reset()

func (*Player) String

func (x *Player) String() string

type ResourceInfo

type ResourceInfo struct {

	// Has exactly as many elements as there are cell types.
	NumPieces []int32 `protobuf:"varint,1,rep,packed,name=num_pieces,json=numPieces,proto3" json:"num_pieces,omitempty"`
	// contains filtered or unexported fields
}

func (*ResourceInfo) Descriptor deprecated

func (*ResourceInfo) Descriptor() ([]byte, []int)

Deprecated: Use ResourceInfo.ProtoReflect.Descriptor instead.

func (*ResourceInfo) GetNumPieces

func (x *ResourceInfo) GetNumPieces() []int32

func (*ResourceInfo) ProtoMessage

func (*ResourceInfo) ProtoMessage()

func (*ResourceInfo) ProtoReflect

func (x *ResourceInfo) ProtoReflect() protoreflect.Message

func (*ResourceInfo) Reset

func (x *ResourceInfo) Reset()

func (*ResourceInfo) String

func (x *ResourceInfo) String() string

type SuggestMoveRequest

type SuggestMoveRequest struct {

	// Maximum time the engine is allowed to think, in milliseconds.
	MaxThinkTimeMs int64 `protobuf:"varint,1,opt,name=max_think_time_ms,json=maxThinkTimeMs,proto3" json:"max_think_time_ms,omitempty"`
	// Game engine state from which to start thinking.
	GameEngineState *GameEngineState `protobuf:"bytes,2,opt,name=game_engine_state,json=gameEngineState,proto3" json:"game_engine_state,omitempty"`
	// contains filtered or unexported fields
}

func (*SuggestMoveRequest) Descriptor deprecated

func (*SuggestMoveRequest) Descriptor() ([]byte, []int)

Deprecated: Use SuggestMoveRequest.ProtoReflect.Descriptor instead.

func (*SuggestMoveRequest) GetGameEngineState

func (x *SuggestMoveRequest) GetGameEngineState() *GameEngineState

func (*SuggestMoveRequest) GetMaxThinkTimeMs

func (x *SuggestMoveRequest) GetMaxThinkTimeMs() int64

func (*SuggestMoveRequest) ProtoMessage

func (*SuggestMoveRequest) ProtoMessage()

func (*SuggestMoveRequest) ProtoReflect

func (x *SuggestMoveRequest) ProtoReflect() protoreflect.Message

func (*SuggestMoveRequest) Reset

func (x *SuggestMoveRequest) Reset()

func (*SuggestMoveRequest) String

func (x *SuggestMoveRequest) String() string

type SuggestMoveResponse

type SuggestMoveResponse struct {
	Move      *GameEngineMove   `protobuf:"bytes,1,opt,name=move,proto3" json:"move,omitempty"`
	MoveStats *SuggestMoveStats `protobuf:"bytes,2,opt,name=move_stats,json=moveStats,proto3" json:"move_stats,omitempty"`
	// contains filtered or unexported fields
}

func (*SuggestMoveResponse) Descriptor deprecated

func (*SuggestMoveResponse) Descriptor() ([]byte, []int)

Deprecated: Use SuggestMoveResponse.ProtoReflect.Descriptor instead.

func (*SuggestMoveResponse) GetMove

func (x *SuggestMoveResponse) GetMove() *GameEngineMove

func (*SuggestMoveResponse) GetMoveStats

func (x *SuggestMoveResponse) GetMoveStats() *SuggestMoveStats

func (*SuggestMoveResponse) ProtoMessage

func (*SuggestMoveResponse) ProtoMessage()

func (*SuggestMoveResponse) ProtoReflect

func (x *SuggestMoveResponse) ProtoReflect() protoreflect.Message

func (*SuggestMoveResponse) Reset

func (x *SuggestMoveResponse) Reset()

func (*SuggestMoveResponse) String

func (x *SuggestMoveResponse) String() string

type SuggestMoveStats

type SuggestMoveStats struct {

	// All scores that the agent generated. If not empty, the first element
	// in the sequence MUST be the FINAL score.
	Moves []*SuggestMoveStats_ScoredMove `protobuf:"bytes,1,rep,name=moves,proto3" json:"moves,omitempty"`
	// (Optional) evaluation of the board as a whole: does it look winning (1) or losing (-1)?
	Value float32 `protobuf:"fixed32,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*SuggestMoveStats) Descriptor deprecated

func (*SuggestMoveStats) Descriptor() ([]byte, []int)

Deprecated: Use SuggestMoveStats.ProtoReflect.Descriptor instead.

func (*SuggestMoveStats) GetMoves

func (*SuggestMoveStats) GetValue

func (x *SuggestMoveStats) GetValue() float32

func (*SuggestMoveStats) ProtoMessage

func (*SuggestMoveStats) ProtoMessage()

func (*SuggestMoveStats) ProtoReflect

func (x *SuggestMoveStats) ProtoReflect() protoreflect.Message

func (*SuggestMoveStats) Reset

func (x *SuggestMoveStats) Reset()

func (*SuggestMoveStats) String

func (x *SuggestMoveStats) String() string

type SuggestMoveStats_Score

type SuggestMoveStats_Score struct {
	Kind  SuggestMoveStats_ScoreKind `protobuf:"varint,1,opt,name=kind,proto3,enum=hexzpb.SuggestMoveStats_ScoreKind" json:"kind,omitempty"`
	Score float32                    `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"`
	// contains filtered or unexported fields
}

func (*SuggestMoveStats_Score) Descriptor deprecated

func (*SuggestMoveStats_Score) Descriptor() ([]byte, []int)

Deprecated: Use SuggestMoveStats_Score.ProtoReflect.Descriptor instead.

func (*SuggestMoveStats_Score) GetKind

func (*SuggestMoveStats_Score) GetScore

func (x *SuggestMoveStats_Score) GetScore() float32

func (*SuggestMoveStats_Score) ProtoMessage

func (*SuggestMoveStats_Score) ProtoMessage()

func (*SuggestMoveStats_Score) ProtoReflect

func (x *SuggestMoveStats_Score) ProtoReflect() protoreflect.Message

func (*SuggestMoveStats_Score) Reset

func (x *SuggestMoveStats_Score) Reset()

func (*SuggestMoveStats_Score) String

func (x *SuggestMoveStats_Score) String() string

type SuggestMoveStats_ScoreKind

type SuggestMoveStats_ScoreKind int32

EvalKind indicates the kind of evaluation that the given value represents.

const (
	// The final evaluation score that was used decide which move to make.
	SuggestMoveStats_FINAL SuggestMoveStats_ScoreKind = 0
	// The prior probabilities of a (neural) MCTS search (a.k.a. move_probs).
	SuggestMoveStats_MCTS_PRIOR SuggestMoveStats_ScoreKind = 1
)

func (SuggestMoveStats_ScoreKind) Descriptor

func (SuggestMoveStats_ScoreKind) Enum

func (SuggestMoveStats_ScoreKind) EnumDescriptor deprecated

func (SuggestMoveStats_ScoreKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use SuggestMoveStats_ScoreKind.Descriptor instead.

func (SuggestMoveStats_ScoreKind) Number

func (SuggestMoveStats_ScoreKind) String

func (SuggestMoveStats_ScoreKind) Type

type SuggestMoveStats_ScoredMove

type SuggestMoveStats_ScoredMove struct {
	Row  int32          `protobuf:"varint,1,opt,name=row,proto3" json:"row,omitempty"`
	Col  int32          `protobuf:"varint,2,opt,name=col,proto3" json:"col,omitempty"`
	Type Field_CellType `protobuf:"varint,3,opt,name=type,proto3,enum=hexzpb.Field_CellType" json:"type,omitempty"`
	// Should be between [0..1] and indicate the likelihood of choosing this move.
	Scores []*SuggestMoveStats_Score `protobuf:"bytes,4,rep,name=scores,proto3" json:"scores,omitempty"`
	// contains filtered or unexported fields
}

func (*SuggestMoveStats_ScoredMove) Descriptor deprecated

func (*SuggestMoveStats_ScoredMove) Descriptor() ([]byte, []int)

Deprecated: Use SuggestMoveStats_ScoredMove.ProtoReflect.Descriptor instead.

func (*SuggestMoveStats_ScoredMove) GetCol

func (x *SuggestMoveStats_ScoredMove) GetCol() int32

func (*SuggestMoveStats_ScoredMove) GetRow

func (x *SuggestMoveStats_ScoredMove) GetRow() int32

func (*SuggestMoveStats_ScoredMove) GetScores

func (*SuggestMoveStats_ScoredMove) GetType

func (*SuggestMoveStats_ScoredMove) ProtoMessage

func (*SuggestMoveStats_ScoredMove) ProtoMessage()

func (*SuggestMoveStats_ScoredMove) ProtoReflect

func (*SuggestMoveStats_ScoredMove) Reset

func (x *SuggestMoveStats_ScoredMove) Reset()

func (*SuggestMoveStats_ScoredMove) String

func (x *SuggestMoveStats_ScoredMove) String() string

type TrainingExample

type TrainingExample struct {

	// Timestamp at which this example was generated.
	UnixMicros int64 `protobuf:"varint,1,opt,name=unix_micros,json=unixMicros,proto3" json:"unix_micros,omitempty"`
	// The player whose turn it was (the current player).
	Turn int32 `protobuf:"varint,7,opt,name=turn,proto3" json:"turn,omitempty"`
	// The move that was made during self-play.
	Move     *GameEngineMove          `protobuf:"bytes,9,opt,name=move,proto3" json:"move,omitempty"`
	Encoding TrainingExample_Encoding `protobuf:"varint,6,opt,name=encoding,proto3,enum=hexzpb.TrainingExample_Encoding" json:"encoding,omitempty"`
	// Training inputs.
	//
	// Encoded array containing the (11, 11, 10) Board from the view of the current player.
	// Serialized to bytes using np.save or torch::pickle_save.
	Board []byte `protobuf:"bytes,2,opt,name=board,proto3" json:"board,omitempty"`
	// Encoded array containing the (2, 11, 10) action mask indicating which moves
	// are valid on the given board.
	ActionMask []byte `protobuf:"bytes,8,opt,name=action_mask,json=actionMask,proto3" json:"action_mask,omitempty"`
	// Training labels.
	//
	// Encoded array containing the (2, 11, 10) move likelihoods.
	// Serialized to bytes using np.save or torch::pickle_save.
	MoveProbs []byte `protobuf:"bytes,3,opt,name=move_probs,json=moveProbs,proto3" json:"move_probs,omitempty"`
	// The outcome of the game, from the perspective of the current player:
	// -1: lost, 0: draw, 1: won
	Result           float32                           `protobuf:"fixed32,4,opt,name=result,proto3" json:"result,omitempty"`
	ModelPredictions *TrainingExample_ModelPredictions `protobuf:"bytes,10,opt,name=model_predictions,json=modelPredictions,proto3" json:"model_predictions,omitempty"`
	// The model that was used to generate this particular example.
	// Strictly speaking, the model can be updated even while a single
	// is generated (i.e. in the middle of a single MCTS tree search).
	// The key stored here is the one that was current when the search was over.
	ModelKey *ModelKey              `protobuf:"bytes,11,opt,name=model_key,json=modelKey,proto3" json:"model_key,omitempty"`
	Stats    *TrainingExample_Stats `protobuf:"bytes,5,opt,name=stats,proto3" json:"stats,omitempty"`
	// contains filtered or unexported fields
}

TrainingExample is used to send training examples across the wire and store them on disk in the Python implementation.

func (*TrainingExample) Descriptor deprecated

func (*TrainingExample) Descriptor() ([]byte, []int)

Deprecated: Use TrainingExample.ProtoReflect.Descriptor instead.

func (*TrainingExample) GetActionMask

func (x *TrainingExample) GetActionMask() []byte

func (*TrainingExample) GetBoard

func (x *TrainingExample) GetBoard() []byte

func (*TrainingExample) GetEncoding

func (x *TrainingExample) GetEncoding() TrainingExample_Encoding

func (*TrainingExample) GetModelKey

func (x *TrainingExample) GetModelKey() *ModelKey

func (*TrainingExample) GetModelPredictions

func (x *TrainingExample) GetModelPredictions() *TrainingExample_ModelPredictions

func (*TrainingExample) GetMove

func (x *TrainingExample) GetMove() *GameEngineMove

func (*TrainingExample) GetMoveProbs

func (x *TrainingExample) GetMoveProbs() []byte

func (*TrainingExample) GetResult

func (x *TrainingExample) GetResult() float32

func (*TrainingExample) GetStats

func (x *TrainingExample) GetStats() *TrainingExample_Stats

func (*TrainingExample) GetTurn

func (x *TrainingExample) GetTurn() int32

func (*TrainingExample) GetUnixMicros

func (x *TrainingExample) GetUnixMicros() int64

func (*TrainingExample) ProtoMessage

func (*TrainingExample) ProtoMessage()

func (*TrainingExample) ProtoReflect

func (x *TrainingExample) ProtoReflect() protoreflect.Message

func (*TrainingExample) Reset

func (x *TrainingExample) Reset()

func (*TrainingExample) String

func (x *TrainingExample) String() string

type TrainingExample_Encoding

type TrainingExample_Encoding int32

Encoding indicates how the bytes fields were encoded. In Python workers, we use numpy (np.save), while in C++ we use PyTorch (torch::pickle_save), since numpy is not available.

const (
	TrainingExample_NUMPY   TrainingExample_Encoding = 0
	TrainingExample_PYTORCH TrainingExample_Encoding = 1
)

func (TrainingExample_Encoding) Descriptor

func (TrainingExample_Encoding) Enum

func (TrainingExample_Encoding) EnumDescriptor deprecated

func (TrainingExample_Encoding) EnumDescriptor() ([]byte, []int)

Deprecated: Use TrainingExample_Encoding.Descriptor instead.

func (TrainingExample_Encoding) Number

func (TrainingExample_Encoding) String

func (x TrainingExample_Encoding) String() string

func (TrainingExample_Encoding) Type

type TrainingExample_ModelPredictions

type TrainingExample_ModelPredictions struct {

	// Encoded array containing the (2, 11, 10) prior move probabilities as predicted
	// by the model. If enabled, contains the added Dirichlet noise, i.e., these
	// priors were used for the neural MCTS runs.
	Priors []byte  `protobuf:"bytes,1,opt,name=priors,proto3" json:"priors,omitempty"`
	Value  float32 `protobuf:"fixed32,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Model outputs during self-play.

func (*TrainingExample_ModelPredictions) Descriptor deprecated

func (*TrainingExample_ModelPredictions) Descriptor() ([]byte, []int)

Deprecated: Use TrainingExample_ModelPredictions.ProtoReflect.Descriptor instead.

func (*TrainingExample_ModelPredictions) GetPriors

func (x *TrainingExample_ModelPredictions) GetPriors() []byte

func (*TrainingExample_ModelPredictions) GetValue

func (*TrainingExample_ModelPredictions) ProtoMessage

func (*TrainingExample_ModelPredictions) ProtoMessage()

func (*TrainingExample_ModelPredictions) ProtoReflect

func (*TrainingExample_ModelPredictions) Reset

func (*TrainingExample_ModelPredictions) String

type TrainingExample_Stats

type TrainingExample_Stats struct {

	// Time it took to generate this example (i.e., to generate the corresponding
	// neural MCTS move suggestion).
	DurationMicros int64 `protobuf:"varint,1,opt,name=duration_micros,json=durationMicros,proto3" json:"duration_micros,omitempty"`
	// Number of valid moves (equal to the number of root child nodes).
	ValidMoves int32 `protobuf:"varint,2,opt,name=valid_moves,json=validMoves,proto3" json:"valid_moves,omitempty"`
	// Times that the root node was visited.
	VisitCount int32 `protobuf:"varint,3,opt,name=visit_count,json=visitCount,proto3" json:"visit_count,omitempty"`
	// Child nodes of the root node that were visited at least once.
	VisitedChildren int32 `protobuf:"varint,4,opt,name=visited_children,json=visitedChildren,proto3" json:"visited_children,omitempty"`
	// Maximum depth of the search tree. The root node has depth 0.
	SearchDepth int32 `protobuf:"varint,5,opt,name=search_depth,json=searchDepth,proto3" json:"search_depth,omitempty"`
	// Total number of nodes in the search tree, including leaves.
	SearchTreeSize int32 `protobuf:"varint,6,opt,name=search_tree_size,json=searchTreeSize,proto3" json:"search_tree_size,omitempty"`
	// Number of non-leaf nodes in the tree, i.e. those visited at least once.
	BranchNodes int32 `protobuf:"varint,7,opt,name=branch_nodes,json=branchNodes,proto3" json:"branch_nodes,omitempty"`
	// Min/max visit counts of the root node's children.
	MinChildVc int32 `protobuf:"varint,8,opt,name=min_child_vc,json=minChildVc,proto3" json:"min_child_vc,omitempty"`
	MaxChildVc int32 `protobuf:"varint,9,opt,name=max_child_vc,json=maxChildVc,proto3" json:"max_child_vc,omitempty"`
	// The Q-value of the selected child node, i.e. wins/visit_count.
	SelectedChildQ int32 `protobuf:"varint,13,opt,name=selected_child_q,json=selectedChildQ,proto3" json:"selected_child_q,omitempty"`
	// The visit count of the selected child node.
	SelectedChildVc int32 `protobuf:"varint,10,opt,name=selected_child_vc,json=selectedChildVc,proto3" json:"selected_child_vc,omitempty"`
	// Number of nodes per depth level in the tree.
	NodesPerDepth []int32 `protobuf:"varint,12,rep,packed,name=nodes_per_depth,json=nodesPerDepth,proto3" json:"nodes_per_depth,omitempty"`
	// contains filtered or unexported fields
}

func (*TrainingExample_Stats) Descriptor deprecated

func (*TrainingExample_Stats) Descriptor() ([]byte, []int)

Deprecated: Use TrainingExample_Stats.ProtoReflect.Descriptor instead.

func (*TrainingExample_Stats) GetBranchNodes

func (x *TrainingExample_Stats) GetBranchNodes() int32

func (*TrainingExample_Stats) GetDurationMicros

func (x *TrainingExample_Stats) GetDurationMicros() int64

func (*TrainingExample_Stats) GetMaxChildVc

func (x *TrainingExample_Stats) GetMaxChildVc() int32

func (*TrainingExample_Stats) GetMinChildVc

func (x *TrainingExample_Stats) GetMinChildVc() int32

func (*TrainingExample_Stats) GetNodesPerDepth

func (x *TrainingExample_Stats) GetNodesPerDepth() []int32

func (*TrainingExample_Stats) GetSearchDepth

func (x *TrainingExample_Stats) GetSearchDepth() int32

func (*TrainingExample_Stats) GetSearchTreeSize

func (x *TrainingExample_Stats) GetSearchTreeSize() int32

func (*TrainingExample_Stats) GetSelectedChildQ

func (x *TrainingExample_Stats) GetSelectedChildQ() int32

func (*TrainingExample_Stats) GetSelectedChildVc

func (x *TrainingExample_Stats) GetSelectedChildVc() int32

func (*TrainingExample_Stats) GetValidMoves

func (x *TrainingExample_Stats) GetValidMoves() int32

func (*TrainingExample_Stats) GetVisitCount

func (x *TrainingExample_Stats) GetVisitCount() int32

func (*TrainingExample_Stats) GetVisitedChildren

func (x *TrainingExample_Stats) GetVisitedChildren() int32

func (*TrainingExample_Stats) ProtoMessage

func (*TrainingExample_Stats) ProtoMessage()

func (*TrainingExample_Stats) ProtoReflect

func (x *TrainingExample_Stats) ProtoReflect() protoreflect.Message

func (*TrainingExample_Stats) Reset

func (x *TrainingExample_Stats) Reset()

func (*TrainingExample_Stats) String

func (x *TrainingExample_Stats) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL