From 4a39a8fd07e49db5feb0c403b784423f0b673f97 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sat, 12 Jun 2021 10:58:21 +0200 Subject: First MonteCarlo match simulations. --- doc/diagrams/GameBoard.pumlc | 28 ++++++++++++++++++++++++++++ doc/diagrams/GameMove.pumlc | 20 +++++++++++++++----- doc/diagrams/GameState.pumlc | 16 ++++++++++------ doc/diagrams/GameTree.pumlc | 4 ++-- doc/diagrams/gameRepresentation.puml | 9 ++++++--- doc/diagrams/gtpEngine.puml | 15 +++++++++++---- 6 files changed, 72 insertions(+), 20 deletions(-) create mode 100644 doc/diagrams/GameBoard.pumlc (limited to 'doc/diagrams') diff --git a/doc/diagrams/GameBoard.pumlc b/doc/diagrams/GameBoard.pumlc new file mode 100644 index 0000000..7a57b2d --- /dev/null +++ b/doc/diagrams/GameBoard.pumlc @@ -0,0 +1,28 @@ +@startuml + +class GameBoard { + int[][] board + int capturesBlack + int capturesWhite + + getBoard(self) + getBoardHeight(self) + getBoardWidth(self) + getDeepCopy(self) + getGroupLiberties(self, row, col) + getGroupLibertiesCount(self, row, col) + getGroupCells(self, row, col) + getGroupCellsCount(self, row, col) + moveAndCapture(self, row, col, player) + isMoveInBoardBounds(self, row, col) + isCellEmpty(self, row, col) + isCellEye(self, row, col) + isMoveSuicidal(self, row, col, player) + isMoveKoIllegal(self, row, col, player, prevBoards) + isPlayable(self, row, col, player, prevBoards) + score(self) + equals(self, otherBoard) + printBoard(self) +} + +@enduml diff --git a/doc/diagrams/GameMove.pumlc b/doc/diagrams/GameMove.pumlc index 7dcb5e3..0f75edd 100644 --- a/doc/diagrams/GameMove.pumlc +++ b/doc/diagrams/GameMove.pumlc @@ -1,13 +1,23 @@ @startuml class GameMove { - int player - int row - int col - int[2] makesKo - int[] board + GameBoard board GameMove[] nextMoves GameMove previousMove + boolean isPass + int[2] coords + + getRow(self) + getCol(self) + getPlayer(self) + getNextPlayer(self) + getGameLength(self) + getThisAndPrevBoards(self) + getPlayableVertices(self) + addMove(self, row, col) + addMoveForPlayer(self, row, col, player) + addPass(self) + printBoard(self) } @enduml diff --git a/doc/diagrams/GameState.pumlc b/doc/diagrams/GameState.pumlc index db39d8f..38e1397 100644 --- a/doc/diagrams/GameState.pumlc +++ b/doc/diagrams/GameState.pumlc @@ -1,14 +1,18 @@ @startuml class GameState { - int player - int capturesBlack - int capturesWhite - List board - List prevBoards # for ko + int size GameTree gameTree GameMove lastMove - GameData gameData + 'GameData gameData + + getCurrentPlayer(self) + getPlayerCode(self) + getBoard(self) + playMove(self, row, col) + playMoveForPlayer(self, row, col, player) + playPass(self) + undo(self) } @enduml diff --git a/doc/diagrams/GameTree.pumlc b/doc/diagrams/GameTree.pumlc index 85859d8..10b9251 100644 --- a/doc/diagrams/GameTree.pumlc +++ b/doc/diagrams/GameTree.pumlc @@ -1,8 +1,8 @@ @startuml class GameTree { - GameNode[] firstMoves - GameData gameData + GameMove[] firstMoves + 'GameData gameData } @enduml diff --git a/doc/diagrams/gameRepresentation.puml b/doc/diagrams/gameRepresentation.puml index 9a869f1..db5d5a5 100644 --- a/doc/diagrams/gameRepresentation.puml +++ b/doc/diagrams/gameRepresentation.puml @@ -5,10 +5,13 @@ !include GameState.pumlc !include GameTree.pumlc !include GameMove.pumlc +!include GameBoard.pumlc -GameState --> GameTree -GameState --> GameMove: Current move +GameState -> GameTree +GameState --> GameMove: Last move GameTree *--> GameMove -GameMove -> GameMove +GameMove --> GameMove: Previous move +GameMove *--> GameMove: Next moves +GameBoard <- GameMove @enduml diff --git a/doc/diagrams/gtpEngine.puml b/doc/diagrams/gtpEngine.puml index c4caf32..5b098da 100644 --- a/doc/diagrams/gtpEngine.puml +++ b/doc/diagrams/gtpEngine.puml @@ -2,13 +2,20 @@ !include skinparams.puml -class EngineCore { -} - class IO { processComand() } +class EngineCore { + setBoardsize() + clearBoard() + setKomi() + setFixedHandicap() + play() + genmove() + undo() +} + !include GameState.pumlc 'class EngineBoard { @@ -22,7 +29,7 @@ class EngineAI { genmove(board) } -EngineCore --> IO +IO --> EngineCore EngineCore --> GameState EngineCore --> EngineAI -- cgit v1.2.1