Spaces:
Sleeping
Sleeping
""" | |
FileName: const.py | |
Author: Benhao Huang | |
Create Date: 2023/11/19 | |
Description: Some const value for Demo | |
""" | |
import numpy as np | |
_AI_AID_INFO = ["Use AI Aid", "Close AI Aid"] | |
_BOARD_SIZE = 9 | |
_BOARD_SIZE_1D = _BOARD_SIZE * _BOARD_SIZE | |
_BLANK = 0 | |
_BLACK = 1 | |
_WHITE = 2 | |
_HUMAN = 4 | |
_AI = 5 | |
_NEW = 3 | |
_PLAYER_SYMBOL1 = { | |
_WHITE: "βͺ", | |
_BLANK: "β", | |
_BLACK: "β«", | |
_NEW: "π΄", | |
} | |
_PLAYER_SYMBOL2 = { | |
_BLACK: "βͺ", | |
_BLANK: "β", | |
_WHITE: "β«", | |
_NEW: "π΄", | |
} | |
_PLAYER_NAME = { | |
_AI: "AI", | |
_BLANK: "Blank", | |
_HUMAN: "YOU HUMAN", | |
} | |
_PLAYER_COLOR_AI_VS_AI = { | |
_WHITE: "WHITE", | |
_BLANK: "Blank", | |
_BLACK: "BLACK", | |
} | |
_PLAYER_COLOR = { | |
_WHITE: "WHITE", | |
_BLANK: "Blank", | |
_BLACK: "BLACK", | |
} | |
_HORIZONTAL = np.array( | |
[ | |
[0, 0, 0, 0, 0], | |
[0, 0, 0, 0, 0], | |
[1, 1, 1, 1, 1], | |
[0, 0, 0, 0, 0], | |
[0, 0, 0, 0, 0], | |
] | |
) | |
_VERTICAL = np.array( | |
[ | |
[0, 0, 1, 0, 0], | |
[0, 0, 1, 0, 0], | |
[0, 0, 1, 0, 0], | |
[0, 0, 1, 0, 0], | |
[0, 0, 1, 0, 0], | |
] | |
) | |
_DIAGONAL_UP_LEFT = np.array( | |
[ | |
[1, 0, 0, 0, 0], | |
[0, 1, 0, 0, 0], | |
[0, 0, 1, 0, 0], | |
[0, 0, 0, 1, 0], | |
[0, 0, 0, 0, 1], | |
] | |
) | |
_DIAGONAL_UP_RIGHT = np.array( | |
[ | |
[0, 0, 0, 0, 1], | |
[0, 0, 0, 1, 0], | |
[0, 0, 1, 0, 0], | |
[0, 1, 0, 0, 0], | |
[1, 0, 0, 0, 0], | |
] | |
) | |
_ROOM_COLOR = { | |
True: _BLACK, | |
False: _WHITE, | |
} | |
_MODEL_PATH = { | |
"AlphaZero": "Gomoku_MCTS/checkpoint/2023-12-14-18-17-07_test_teaching_learning_collect_epochs=1000_size=9_model=normal/best_policy.model", | |
"duel": "Gomoku_MCTS/checkpoint/second-stage-duel_epochs=1000_size=9_model=duel/best_policy.model", | |
"Gumbel AlphaZero": "Gomoku_MCTS/checkpoint/2023-12-14-21-19-40_selfplay_epochs=1000_size=9_model=gumbel/best_policy.model", | |
} | |
# _MODEL_PATH = { | |
# "AlphaZero": "Gomoku_MCTS/checkpoint/2023-12-14-18-17-07_test_teaching_learning_collect_epochs=1000_size=9_model=normal/best_policy.model", | |
# "duel": "Gomoku_MCTS/checkpoint/2023-12-14-10-22-12_test_teaching_learning_collect_epochs=1000_size=9_model=duel/best_policy.model", | |
# "Gumbel AlphaZero": "Gomoku_MCTS/checkpoint/2023-12-14-21-19-40_selfplay_epochs=1000_size=9_model=gumbel/best_policy.model", | |
# } | |