My Project
midgame.c File Reference
#include "search.h"
#include "bit.h"
#include "options.h"
#include "stats.h"
#include "ybwc.h"
#include "settings.h"
#include <assert.h>
#include <math.h>

Go to the source code of this file.

Macros

#define RCD   0.5
 

Functions

int search_eval_0 (Search *search)
 evaluate a midgame position with the evaluation function.
 
int search_eval_1 (Search *search, const int alpha, int beta)
 Evaluate a position at depth 1.
 
int search_eval_2 (Search *search, int alpha, const int beta)
 Evaluate a position at depth 2.
 
static void search_update_probcut (Search *search, const NodeType node_type)
 
static void search_restore_probcut (Search *search, const NodeType node_type, const int selectivity)
 
static bool search_probcut (Search *search, const int alpha, const int depth, Node *parent, int *value)
 Probcut.
 
int NWS_shallow (Search *search, const int alpha, int depth, HashTable *hash_table)
 Evaluate a midgame position with a Null Window Search algorithm.
 
int PVS_shallow (Search *search, int alpha, int beta, int depth)
 Evaluate a midgame position at shallow depth.
 
int NWS_midgame (Search *search, const int alpha, int depth, Node *parent)
 Evaluate a midgame position with a Null Window Search algorithm.
 
int PVS_midgame (Search *search, const int alpha, const int beta, int depth, Node *parent)
 Evaluate a position with a deep Principal Variation Search algorithm.
 

Detailed Description

Search near the end of the game.

Date
1998 - 2017
Author
Richard Delorme
Version
4.4

Macro Definition Documentation

◆ RCD

#define RCD   0.5

macro RCD : set to 0.0 if -rcd is added to the icc compiler

Function Documentation

◆ NWS_midgame()

int NWS_midgame ( Search * search,
const int alpha,
int depth,
Node * parent )

Evaluate a midgame position with a Null Window Search algorithm.

This function is used when there are still many empty squares on the board. Move ordering, hash table cutoff, enhanced transposition cutoff, etc. are used in order to diminish the size of the tree to analyse, but at the expense of a slower speed.

Parameters
searchSearch.
alphaAlpha bound.
depthDepth.
parentParent node.
Returns
A score, as a disc difference.

◆ NWS_shallow()

int NWS_shallow ( Search * search,
const int alpha,
int depth,
HashTable * hash_table )

Evaluate a midgame position with a Null Window Search algorithm.

This function is used when there are still many empty squares on the board. Move ordering, hash table cutoff, enhanced transposition cutoff, etc. are used in order to diminish the size of the tree to analyse, but at the expense of a slower speed.

Parameters
searchsearch.
alphalower bound.
depthSearch remaining depth.
hash_tableHash Table to use.
Returns
An evaluated score, as a disc difference.

◆ PVS_midgame()

int PVS_midgame ( Search * search,
const int alpha,
const int beta,
int depth,
Node * parent )

Evaluate a position with a deep Principal Variation Search algorithm.

This function is used when there are still many empty squares on the board. Move ordering, hash table cutoff, enhanced transposition cutoff, etc. are used in order to diminish the size of the tree to analyse, but at the expense of a slower speed.

Parameters
searchSearch.
alphaLower bound.
betaUpper bound.
depthDepth.
parentParent node.
Returns
A score, as a disc difference.

◆ PVS_shallow()

int PVS_shallow ( Search * search,
int alpha,
int beta,
int depth )

Evaluate a midgame position at shallow depth.

This function is used when there are still many empty squares on the board. Move ordering, hash table cutoff, enhanced transposition cutoff, etc. are used in order to diminish the size of the tree to analyse, but at the expense of a slower speed.

Parameters
searchSearch.
alphaAlpha bound.
betaBeta bound.
depthSearch depth.
Returns
An evaluated score, as a disc difference.

◆ search_eval_0()

int search_eval_0 ( Search * search)

evaluate a midgame position with the evaluation function.

Parameters
searchPosition to evaluate.

◆ search_eval_1()

int search_eval_1 ( Search * search,
const int alpha,
int beta )

Evaluate a position at depth 1.

As an optimization, the last move is used to only updates the evaluation features.

Parameters
searchPosition to evaluate.
alphaAlpha bound.
betaBeta bound.

◆ search_eval_2()

int search_eval_2 ( Search * search,
int alpha,
const int beta )

Evaluate a position at depth 2.

Simple alpha-beta with no move sorting.

Parameters
searchPosition to evaluate.
alphaLower bound
betaUpper bound

◆ search_probcut()

static bool search_probcut ( Search * search,
const int alpha,
const int depth,
Node * parent,
int * value )
static

Probcut.

Check if a position is worth to analyze further.

Parameters
searchPosition to test.
alphaAlpha lower bound.
depthSearch depth.
parentParent node.
valueReturned value.
Returns
true if probable cutoff has been found, false otherwise.

◆ search_restore_probcut()

static void search_restore_probcut ( Search * search,
const NodeType node_type,
const int selectivity )
inlinestatic

◆ search_update_probcut()

static void search_update_probcut ( Search * search,
const NodeType node_type )
inlinestatic