2019-11-03 13:00:45 +08:00
|
|
|
/*
|
|
|
|
Sanmill, a mill game playing engine derived from NineChess 1.5
|
|
|
|
Copyright (C) 2015-2018 liuweilhy (NineChess author)
|
2020-01-29 22:22:51 +08:00
|
|
|
Copyright (C) 2019-2020 Calcitem <calcitem@outlook.com>
|
2019-11-03 13:00:45 +08:00
|
|
|
|
|
|
|
Sanmill is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Sanmill is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2019-07-28 02:40:49 +08:00
|
|
|
|
2019-06-30 07:40:27 +08:00
|
|
|
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H
|
|
|
|
|
2019-09-07 19:19:45 +08:00
|
|
|
#include "debug.h"
|
|
|
|
|
2019-08-11 14:26:36 +08:00
|
|
|
#if _MSC_VER >= 1600
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
#endif
|
|
|
|
|
2019-08-26 22:33:27 +08:00
|
|
|
//#define MOBILE_APP_UI
|
|
|
|
|
2019-10-26 21:40:26 +08:00
|
|
|
//#define TRAINING_MODE
|
|
|
|
|
2019-12-13 22:42:07 +08:00
|
|
|
//#define TEST_MODE
|
|
|
|
|
2019-12-15 23:56:56 +08:00
|
|
|
//#define UCT_DEMO
|
|
|
|
|
2020-02-26 02:28:09 +08:00
|
|
|
#define ALPHABETA_AI
|
2020-02-26 02:02:39 +08:00
|
|
|
//#define MCTS_AI
|
|
|
|
|
2020-03-06 00:17:10 +08:00
|
|
|
//#define MCTS_PLD
|
|
|
|
|
2019-12-13 22:42:07 +08:00
|
|
|
#ifdef TEST_MODE
|
|
|
|
#define DONOT_PLAY_SOUND
|
|
|
|
#endif // TEST_MODE
|
|
|
|
|
2019-07-20 18:30:05 +08:00
|
|
|
//#define DEBUG_MODE
|
2019-08-04 13:12:29 +08:00
|
|
|
//#define DEBUG_MODE_A
|
2019-06-30 07:40:27 +08:00
|
|
|
|
2019-08-04 13:12:29 +08:00
|
|
|
#ifdef DEBUG_MODE_A
|
|
|
|
#define DONOT_PLAY_SOUND
|
|
|
|
#else
|
2019-07-21 03:26:03 +08:00
|
|
|
#define RANDOM_MOVE
|
2019-08-04 13:12:29 +08:00
|
|
|
#endif
|
2019-07-10 01:00:06 +08:00
|
|
|
|
2019-10-26 19:03:18 +08:00
|
|
|
#define DEFAULT_RULE_NUMBER 1
|
|
|
|
|
2019-11-03 17:43:27 +08:00
|
|
|
#define DEPTH_ADJUST (0)
|
2020-03-20 01:10:49 +08:00
|
|
|
//#define FIX_DEPTH (24)
|
2019-11-03 17:43:27 +08:00
|
|
|
|
2020-03-20 22:20:57 +08:00
|
|
|
//#define FIRST_MOVE_STAR_PREFERRED
|
|
|
|
|
2019-10-07 16:40:52 +08:00
|
|
|
//#define TIME_STAT
|
2019-11-10 12:36:31 +08:00
|
|
|
//#define CYCLE_STAT
|
2019-10-07 16:40:52 +08:00
|
|
|
|
2019-08-24 21:31:16 +08:00
|
|
|
//#define MIN_MAX_ONLY
|
|
|
|
|
2019-09-02 21:58:45 +08:00
|
|
|
//#define EVALUATE_ENABLE
|
2019-08-04 11:22:49 +08:00
|
|
|
|
|
|
|
#ifdef EVALUATE_ENABLE
|
2019-09-01 11:02:51 +08:00
|
|
|
//#define EVALUATE_MATERIAL
|
|
|
|
//#define EVALUATE_SPACE
|
2019-08-04 11:22:49 +08:00
|
|
|
#define EVALUATE_MOBILITY
|
2019-09-01 11:02:51 +08:00
|
|
|
//#define EVALUATE_TEMPO
|
|
|
|
//#define EVALUATE_THREAT
|
|
|
|
//#define EVALUATE_SHAPE
|
|
|
|
//#define EVALUATE_MOTIF
|
2019-08-04 11:22:49 +08:00
|
|
|
#endif /* EVALUATE_ENABLE */
|
|
|
|
|
2019-10-23 00:22:15 +08:00
|
|
|
#define SORT_MOVE_WITH_HUMAN_KNOWLEDGES
|
2019-08-04 03:17:53 +08:00
|
|
|
|
2019-10-20 03:14:20 +08:00
|
|
|
//#define IDS_WINDOW
|
2019-10-21 00:06:17 +08:00
|
|
|
//#define IDS_DEBUG
|
2019-10-16 00:42:31 +08:00
|
|
|
//#define IDS_ADD_VALUE
|
2019-07-05 01:17:17 +08:00
|
|
|
|
2019-10-15 01:52:24 +08:00
|
|
|
//#define CLEAR_PRUNED_FLAG_BEFORE_SEARCH
|
2019-10-20 11:27:39 +08:00
|
|
|
//#define DEEPER_IF_ONLY_ONE_LEGAL_MOVE
|
2019-08-06 01:19:21 +08:00
|
|
|
|
2019-09-09 00:19:02 +08:00
|
|
|
#define TRANSPOSITION_TABLE_ENABLE
|
2019-07-04 00:12:05 +08:00
|
|
|
|
2019-09-09 00:19:02 +08:00
|
|
|
#ifdef TRANSPOSITION_TABLE_ENABLE
|
|
|
|
#define CLEAR_TRANSPOSITION_TABLE
|
2019-10-02 12:18:31 +08:00
|
|
|
#define TRANSPOSITION_TABLE_FAKE_CLEAN
|
2019-09-09 00:19:02 +08:00
|
|
|
#define TRANSPOSITION_TABLE_CUTDOWN
|
2020-01-25 09:23:50 +08:00
|
|
|
//#define BEST_MOVE_ENABLE
|
2019-09-09 00:19:02 +08:00
|
|
|
//#define TRANSPOSITION_TABLE_DEBUG
|
2019-08-18 12:40:06 +08:00
|
|
|
#endif
|
2019-08-13 23:28:18 +08:00
|
|
|
|
2020-04-19 02:53:04 +08:00
|
|
|
//#define PREFETCH_SUPPORT
|
|
|
|
|
2019-10-02 11:25:52 +08:00
|
|
|
//#define USE_STD_STACK
|
|
|
|
|
2019-09-08 23:31:38 +08:00
|
|
|
//#define RAPID_GAME
|
2019-07-30 23:51:33 +08:00
|
|
|
|
2019-10-29 00:30:29 +08:00
|
|
|
//#define ENDGAME_LEARNING
|
2019-12-23 00:26:02 +08:00
|
|
|
//#define ENDGAME_LEARNING_FORCE
|
|
|
|
//#define ENDGAME_LEARNING_DEBUG
|
2019-07-04 00:12:05 +08:00
|
|
|
|
2019-07-27 02:44:24 +08:00
|
|
|
#define THREEFOLD_REPETITION
|
|
|
|
|
2019-07-07 23:14:35 +08:00
|
|
|
//#define DONOT_DELETE_TREE
|
2019-07-07 22:27:23 +08:00
|
|
|
|
重新开启 SORT_CONSIDER_PRUNED 宏
开启后,相对未开启,黑方赢得更快。
对于自对弈:
(2,2) 00:00.000
(2,4) 00:00.885
(2,8) 00:00.820
(2,1) 00:02.401
(3,2) 00:01.828
(3,1) 00:04.172
(1,2) 00:03.083
-(3,1) 00:07.318
(2,6) 00:06.501
(2,5) 00:10.024
(3,6) 00:10.216
(1,6) 00:13.447
(3,4) 00:13.156
(1,4) 00:16.709
(3,5) 00:15.413
-(1,4) 00:16.775
(1,8) 00:18.199
(3,8) 00:19.026
(1,1) 00:21.073 开启则会成三,而不开启会走 (3,7) 封堵对方的三
2019-08-04 21:28:32 +08:00
|
|
|
#define SORT_CONSIDER_PRUNED
|
2019-08-02 00:57:47 +08:00
|
|
|
|
2019-07-29 22:58:40 +08:00
|
|
|
//#define MESSAGEBOX_ENABLE
|
|
|
|
|
2019-07-20 18:30:05 +08:00
|
|
|
#ifdef DEBUG_MODE
|
2019-06-30 11:59:06 +08:00
|
|
|
#define DONOT_PLAY_SOUND
|
2019-06-30 07:40:27 +08:00
|
|
|
#define DEBUG_AB_TREE
|
|
|
|
#endif
|
|
|
|
|
2019-07-04 00:12:05 +08:00
|
|
|
//#define DONOT_PLAY_SOUND
|
2019-07-03 02:01:22 +08:00
|
|
|
|
2019-07-20 18:30:05 +08:00
|
|
|
#ifdef DEBUG_MODE
|
2019-09-08 15:15:21 +08:00
|
|
|
#define PLAYER_DRAW_SEAT_NUMBER
|
2019-06-30 07:40:27 +08:00
|
|
|
#endif
|
|
|
|
|
2019-08-27 13:52:08 +08:00
|
|
|
#ifndef MOBILE_APP_UI
|
2019-09-08 23:31:38 +08:00
|
|
|
#define SAVE_GAMEBOOK_WHEN_ACTION_NEW_TRIGGERED
|
2019-08-27 13:52:08 +08:00
|
|
|
#endif
|
2019-06-30 09:57:44 +08:00
|
|
|
|
|
|
|
// #define DONOT_PLAY_WIN_SOUND
|
|
|
|
|
2019-06-30 07:40:27 +08:00
|
|
|
// 摆棋阶段在叉下面显示被吃的子
|
2019-06-30 09:57:44 +08:00
|
|
|
//#define GAME_PLACING_SHOW_CAPTURED_PIECES
|
2019-06-30 07:40:27 +08:00
|
|
|
|
|
|
|
// 启动时窗口最大化
|
|
|
|
//#define SHOW_MAXIMIZED_ON_LOAD
|
|
|
|
|
2019-07-14 22:35:45 +08:00
|
|
|
// 不使用哈希桶
|
|
|
|
#define DISABLE_HASHBUCKET
|
2019-09-14 23:51:41 +08:00
|
|
|
// 哈希表不加锁
|
|
|
|
#define HASHMAP_NOLOCK
|
2019-07-14 22:35:45 +08:00
|
|
|
|
2019-08-18 12:33:30 +08:00
|
|
|
#ifdef WIN32
|
|
|
|
#define sscanf sscanf_s
|
2019-08-25 19:22:53 +08:00
|
|
|
#define sprintf sprintf_s
|
2019-08-18 12:33:30 +08:00
|
|
|
#endif
|
|
|
|
|
2019-10-11 02:02:45 +08:00
|
|
|
#ifndef __GNUC__
|
|
|
|
#define __builtin_expect(expr, n) (expr)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define likely(expr) (__builtin_expect(!!(expr), 1))
|
|
|
|
#define unlikely(expr) (__builtin_expect(!!(expr), 0))
|
|
|
|
|
2019-08-02 00:57:47 +08:00
|
|
|
#endif // CONFIG_H
|