Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/overleaf/images/h2_iterations_by_board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/overleaf/images/human_moves_by_agent.png
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/overleaf/images/human_win_rate_by_agent.png
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
adamgracikowski marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 13 additions & 6 deletions docs/overleaf/outline.tex
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,27 @@ \subsection{Projekt interfejsu graficznego (GUI)}

\subsection{Metodologia testów na graczach (Człowiek vs AI)}

Istotnym aspektem projektu jest ewaluacja jakości działania zaimplementowanych wariantów sztucznej inteligencji przeciwko ludzkim graczom. Eksperyment zostanie przeprowadzony z udziałem grupy badawczej składającej się z 5 różnych osób niezwiązanych z procesem tworzenia algorytmów. Testy zostaną zrealizowane w formule podwójnie ślepej próby na planszach o rozmiarach $7 \times 7$ oraz $8 \times 8$.
Istotnym aspektem projektu jest ewaluacja jakości działania zaimplementowanych wariantów sztucznej inteligencji przeciwko ludzkim graczom. Eksperyment zostanie przeprowadzony z udziałem grupy badawczej składającej się z 5 różnych osób niezwiązanych z procesem tworzenia algorytmów. Testy zostaną zrealizowane w formule ślepej próby na planszach o rozmiarach $7 \times 7$ oraz $8 \times 8$.

\subsubsection{Scenariusz badawczy}
Każdy uczestnik badania zostanie poproszony o rozegranie serii czterech spotkań. Przeciwnikami będą:
Każdy uczestnik badania zostanie poproszony o rozegranie serii spotkań przeciwko czterem wariantom sztucznej inteligencji. Przeciwnikami będą:
\begin{enumerate}
\item Klasyczny algorytm UCT.
\item Modyfikacja UCT z algorytmem RAVE .
\item Modyfikacja UCT z algorytmem RAVE.
\item Modyfikacja UCT z Heavy Playouts.
\item Algorytm Minimax z ewaluacją heurystyczną.
\end{enumerate}
Dla algorytmu UCT oraz jego modyfikacji zostanie ustawiony limit czasowy wynoszący 3 sekundy. W interfejsie graficznym zostaną wyłączone etykiety identyfikujące algorytmy, aby nie wpływały one na późniejszą ocenę uczestnika. Na interfejsie graficznym widoczny będzie jedynie nazwa ogólna ,,Bot 1'', ,,Bot 2'', ,,Bot 3'', ,,Bot 4''.

Dla algorytmu UCT oraz jego modyfikacji zostanie ustawiony limit czasowy wynoszący 3 sekundy na ruch. Dla algorytmu Minimax planowane jest użycie głębokości przeszukiwania $d = 7$, ponieważ wstępnie odpowiada ona zbliżonemu czasowi namysłu. W razie zbyt krótkiego czasu odpowiedzi wartość ta może zostać zwiększona do $d = 8$.

Dla każdego z agentów człowiek rozegra dwie partie: jedną na planszy $7 \times 7$ jako gracz biały oraz jedną na planszy $8 \times 8$ jako gracz czarny. Taki układ pozwoli zebrać dane dla obu kolorów bez nadmiernego zwiększania liczby partii wymaganych od uczestnika. Kolejność agentów powinna być losowana lub rotowana pomiędzy uczestnikami, aby ograniczyć wpływ uczenia się gry w trakcie badania.

Do uruchamiania sesji zostanie wykorzystany skrypt pomocniczy, który losuje kolejność przygotowanych plików konfiguracyjnych i uruchamia środowisko graficzne osobno dla każdej partii. Po zakończeniu pojedynczej rozgrywki badacz zamyka okno aplikacji, a skrypt automatycznie przechodzi do kolejnej konfiguracji.

W interfejsie graficznym zostanie włączony tryb badawczy (\texttt{blind\_mode}), w którym ukryte są etykiety identyfikujące typ algorytmu oraz panel parametrów przeciwnika. Uczestnik widzi wyłącznie planszę, informację o swojej turze, neutralny komunikat o tym, że agent oblicza ruch, oraz wynik zakończonej partii. Dane identyfikujące agenta pozostają zapisane w logach eksperymentalnych, ponieważ są potrzebne do późniejszej analizy.

\subsubsection{Zbiór danych i ankietyzacja}
Z każdej partii rozegranej z człowiekiem system automatycznie zapisze metryki gry do pliku .csv, analogiczne do tych zbieranych w scenariuszu \textit{self-play}, w tym: rezultat końcowy partii oraz czas decyzyjny ludzkiego gracza.
Z każdej partii rozegranej z człowiekiem system automatycznie zapisze metryki gry do pliku JSONL, analogiczne do tych zbieranych w scenariuszu \textit{self-play}, w tym rezultat końcowy partii, sekwencję ruchów oraz czasy decyzyjne obu graczy. Kolejne partie mogą być dopisywane do tego samego pliku wynikowego, co upraszcza późniejszą analizę danych z całej sesji badawczej.

Po zakończeniu wszystkich rozgrywek, badany wypełni krótką ankietę bazującą na skali Likerta. Uczestnik zostanie poproszony o przyporządkowanie punktacji i krótkie uzasadnienie dla każdego z czterech napotkanych przeciwników w kategoriach:
\begin{itemize}
Expand Down Expand Up @@ -553,4 +560,4 @@ \section{Harmonogram działań}

\end{thebibliography}

\end{document}
\end{document}
314 changes: 313 additions & 1 deletion docs/overleaf/report.tex
Comment thread
adamgracikowski marked this conversation as resolved.

Large diffs are not rendered by default.

Binary file modified docs/report.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion src/analysis/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.jsonl
*.toml
*.png
*.txt
*.txt
*.csv
78 changes: 78 additions & 0 deletions src/analysis/experiments/h1/configs_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import shutil
from pathlib import Path


BOARD_SIZES = [(7, 7), (8, 8), (6, 8), (8, 6)]
MCTS_ITERATIONS = 10000
EXPLORATION_CONSTANT = 1.41
RAVE_K_VALUE = 100


def format_agent(config: dict) -> str:
lines = []
for key, value in config.items():
if isinstance(value, str):
lines.append(f'{key} = "{value}"')
elif isinstance(value, bool):
lines.append(f"{key} = {str(value).lower()}")
else:
lines.append(f"{key} = {value}")
return "\n".join(lines)


def format_config(board_width: int, board_height: int, white: dict, black: dict) -> str:
return (
f"board_width = {board_width}\n"
f"board_height = {board_height}\n\n"
"[white_player]\n"
f"{format_agent(white)}\n\n"
"[black_player]\n"
f"{format_agent(black)}\n"
)


def write_config(output_dir: Path, name: str, board_width: int, board_height: int, white: dict, black: dict):
path = output_dir / f"{name}.toml"
path.write_text(format_config(board_width, board_height, white, black), encoding="utf-8")


def generate_configs(output_dir: Path):
if output_dir.exists():
shutil.rmtree(output_dir)
output_dir.mkdir(parents=True, exist_ok=True)

uct_agent = {
"type": "Mcts",
"max_iterations": MCTS_ITERATIONS,
"exploration_constant": EXPLORATION_CONSTANT,
}
rave_agent = {
"type": "Mcts",
"max_iterations": MCTS_ITERATIONS,
"exploration_constant": EXPLORATION_CONSTANT,
"use_rave": True,
"rave_k": RAVE_K_VALUE,
}

for width, height in BOARD_SIZES:
board_name = f"{width}x{height}"
write_config(
output_dir,
f"h1_{board_name}_rave_white_vs_uct_black",
width,
height,
rave_agent,
uct_agent,
)
write_config(
output_dir,
f"h1_{board_name}_uct_white_vs_rave_black",
width,
height,
uct_agent,
rave_agent,
)


if __name__ == "__main__":
generate_configs(Path(__file__).parent / "configs")
Loading
Loading