<commit_before>/* Module imports */
?- ['../engine/engine'].
?- ['positional'].
?- ['score'].

% Combination of score and positional heuristics
% For the first 40 moves positional heuristic is used
% And for the last ones, score heuristic is chosen

/**
 * count_moves/2
 * Counts the number of moves already played on the Board
 * @1: +Board - the  Board
 * @2: -NumberOfMoves - the number of moves already done
 */
count_moves([], 0).
count_moves(Board, NumberOfMoves) :-
	score(Board, e, EmptySquares),
	NumberOfMoves is 60 - EmptySquares,
	!.

heuristic_combination_score_and_positional(Board, Player, Score) :-
	count_moves(Board, NumberOfMoves),
	NumberOfMoves =< 40,
	heuristic_positional_score(Board, Player, Score),
	!.

heuristic_combination_score_and_positional(Board, Player, Score) :-
	count_moves(Board, NumberOfMoves),
	NumberOfMoves > 40,
	heuristic_score(Board, Player, Score),
	!.<commit_msg>change threshold for combination heuristic<commit_after>/* Module imports */
?- ['../engine/engine'].
?- ['positional'].
?- ['score'].

% Combination of score and positional heuristics
% For the first 40 moves positional heuristic is used
% And for the last ones, score heuristic is chosen

/**
 * count_moves/2
 * Counts the number of moves already played on the Board
 * @1: +Board - the  Board
 * @2: -NumberOfMoves - the number of moves already done
 */
count_moves([], 0).
count_moves(Board, NumberOfMoves) :-
	score(Board, e, EmptySquares),
	NumberOfMoves is 60 - EmptySquares,
	!.

heuristic_combination_score_and_positional(Board, Player, Score) :-
	count_moves(Board, NumberOfMoves),
	NumberOfMoves =< 50,
	heuristic_positional_score(Board, Player, Score),
	!.

heuristic_combination_score_and_positional(Board, Player, Score) :-
	count_moves(Board, NumberOfMoves),
	NumberOfMoves > 50,
	heuristic_score(Board, Player, Score),
	!.
{'fraction_non_alphanumeric': 0.12222823147647377, 'fraction_numerical': 0.012979989183342347, 'mean_word_length': 4.9105431309904155, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5200209', 'n_tokens_mistral': 664, 'n_tokens_neox': 602, 'n_words': 172}