Skip to content

Commit

Permalink
Merge pull request #12 from kobanium/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
KunihitoHoki authored Jul 9, 2019
2 parents ebe9bb0 + 159732d commit 41b3ac7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/common/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
namespace Ver {
constexpr unsigned char major = 1;
constexpr unsigned char minor = 1;
constexpr unsigned short usi_engin = 10;
constexpr unsigned short usi_engin = 11;
}
1 change: 1 addition & 0 deletions src/usi-engine/bona/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ main()
}
init_seqence_hash();
init_yss_zero();
//{ void test_dist_loop(); test_dist_loop(); exit(1); }
#endif

if ( ini( ptree ) < 0 )
Expand Down
3 changes: 2 additions & 1 deletion src/usi-engine/bona/shogi.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ extern unsigned char ailast_one[512];
//#define BNZ_VER "7" // 20190420
//#define BNZ_VER "8" // 20190430
//#define BNZ_VER "9" // 20190527
#define BNZ_VER "10" // 20190708
//#define BNZ_VER "10" // 20190708
#define BNZ_VER "11" // 20190709
#define BNZ_NAME "AobaZero"

#define REP_MAX_PLY 32
Expand Down
16 changes: 8 additions & 8 deletions src/usi-engine/bona/ysszero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ unsigned long rand_m521()
return mx521[rnd521_count];
}
#else
//std::random_device seed_gen;

std::mt19937 get_mt_rand;

void init_rnd521(unsigned long u_seed)
Expand Down Expand Up @@ -723,9 +723,9 @@ int uct_search_start(tree_t * restrict ptree, int sideToMove, int ply, char *buf
if ( s > r ) break;
}
#else
static std::mt19937_64 mt64;
// static std::mt19937_64 mt64;
static std::uniform_real_distribution<> dist(0, 1);
double indicator = dist(mt64);
double indicator = dist(get_mt_rand);

double inv_temperature = 1.0 / cfg_random_temp;
double wheel[MAX_LEGAL_MOVES];
Expand Down Expand Up @@ -1127,7 +1127,6 @@ std::string keep_cmd_line;

int getCmdLineParam(int argc, char *argv[])
{
//{ void test_dist_loop(); test_dist_loop(); exit(1); }
int i;
for (i=1; i<argc; i++) {
char sa[2][TMP_BUF_LEN];
Expand Down Expand Up @@ -1332,15 +1331,16 @@ void usi_newgame()

void test_dist()
{
static std::mt19937_64 mt64;
// std::random_device rd;
// mt64.seed(rd());
const int N = 10;
int count[N];
for (int i=0; i<N; i++) count[i] = 0;
for (int loop=0; loop < 1000; loop++) {
static std::mt19937_64 mt64;
std::random_device rd;
mt64.seed(rd());
static std::uniform_real_distribution<> dist(0, 1);
double indicator = dist(mt64);
// double indicator = dist(mt64);
double indicator = dist(get_mt_rand);

double inv_temperature = 1.0 / 1.0;
double wheel[N];
Expand Down

0 comments on commit 41b3ac7

Please sign in to comment.