eval
Class ESFramework

java.lang.Object
  extended by eval.ESFramework

public class ESFramework
extends java.lang.Object

The ESF: Evaluative String Framework is a framework that organises all the strings into a Features array. The framework allows is simpler than the old FeatureManager framework and runs faster (construction is 5 times faster). It retains all functionality of the old FeatureManager class.

Author:
Spork Innovations

Field Summary
static int BISHOP_VS_KNIGHT
          The index for the bishop vs.
static int BLACK_COLUMN_A
           
static int BLACK_COLUMN_B
           
static int BLACK_COLUMN_C
           
static int BLACK_COLUMN_D
           
static int BLACK_COLUMN_E
           
static int BLACK_COLUMN_F
           
static int BLACK_COLUMN_G
           
static int BLACK_COLUMN_H
           
static int BLACK_DOUBLED_PAWNS
          The index for the doubled pawn feature for black.
static int BLACK_ISOLANIS
          The index for the isolated pawns (isolani) feature for black.
static int BLACK_KING_SHIELD
          The index for the king shield feature for black.
static int BLACK_KING_TROPISM
          The index for the king tropism value for black.
static int BLACK_MATERIAL
          The index for the black material imbalance feature.
static int BLACK_PASSED_PAWNS
          The index for the passed pawn feature for black.
static int BLACK_PAWN_ISLANDS
          The index for the pawn island count feature for black.
static int BLACK_SPACE
          The index for the space count feature for black.
static int BUFFER1
          The index for the column structure grouping for white.
static int BUFFER2
          The index for the column structure grouping for white.
static int BUFFER3
           
 java.lang.String[] features
          The container for the evaluative strings.
static int OPPOSITE_BISHOPS
          The index for the opposite bishops imbalance feature.
static int TWO_BISHOPS
          The index for the two bishops feature.
static int WHITE_COLUMN_A
           
static int WHITE_COLUMN_B
           
static int WHITE_COLUMN_C
           
static int WHITE_COLUMN_D
           
static int WHITE_COLUMN_E
           
static int WHITE_COLUMN_F
           
static int WHITE_COLUMN_G
           
static int WHITE_COLUMN_H
           
static int WHITE_DOUBLED_PAWNS
          The index for the doubled pawn feature for white.
static int WHITE_ISOLANIS
          The index for the isolated pawns (isolani) feature for white.
static int WHITE_KING_SHIELD
          The index for the king shield feature for white.
static int WHITE_KING_TROPISM
          The index for the king tropism value for white.
static int WHITE_MATERIAL
          The index for the white material imbalance feature.
static int WHITE_PASSED_PAWNS
          The index for the passed pawn feature for white.
static int WHITE_PAWN_ISLANDS
          The index for the pawn island count feature for white.
static int WHITE_SPACE
          The index for the space count feature for white.
 
Constructor Summary
ESFramework(Position p)
          Constructor: This creates the necessary tools for the framework's existence.
 
Method Summary
 void bishopvknight()
          Detects whether the bishop or knight imbalance is present and stores it in the appropriate index.
 void columnstruct()
          Organises the pawns into structure by column and stores them into the appropriate index.
 void doublepawn()
          Determines the columns where the double pawns are present in the pawn structures for both sides and stores them in the appropriate indices.
 void isolani()
          Determines the column of the isolanis present in the pawn structure and stores them in the appropriate indices.
 void kingshield()
          Determines the king's "pawn shield" as a weighted average for both sides and stores them in the appropriate indices.
 void kingtropism()
          Determines the average distance from the opposing side's pieces to each player's king and stores them in the appropriate indices.
 void material()
          Generates the material imbalance between the two sides and stores it in the appropriate index.
 void oppositebishops()
          Detects whether a situation with opposite coloured bishops (1 bishop each, but one is on a dark square, but its adversary on a white square) is present and stores it in the appropriate index.
 void passpawn()
          Determines the column of the passed pawns present in the pawn structure for both sides and stores them in the appropriate indices.
 void pawnislands()
          Determines the number of pawn islands present in the pawn structure and stores them in the appropriate indices.
 void space()
          Determines the space enclosed by the pawn structure for both sides and stores them in the appropriate indices.
 void twobishops()
          Detects whether each side has a pair of bishops and stores it in the appropriate index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WHITE_MATERIAL

public static final int WHITE_MATERIAL
The index for the white material imbalance feature.

See Also:
Constant Field Values

BLACK_MATERIAL

public static final int BLACK_MATERIAL
The index for the black material imbalance feature.

See Also:
Constant Field Values

BISHOP_VS_KNIGHT

public static final int BISHOP_VS_KNIGHT
The index for the bishop vs. knight imbalance feature.

See Also:
Constant Field Values

TWO_BISHOPS

public static final int TWO_BISHOPS
The index for the two bishops feature.

See Also:
Constant Field Values

OPPOSITE_BISHOPS

public static final int OPPOSITE_BISHOPS
The index for the opposite bishops imbalance feature.

See Also:
Constant Field Values

BUFFER1

public static final int BUFFER1
The index for the column structure grouping for white.

See Also:
Constant Field Values

WHITE_COLUMN_A

public static final int WHITE_COLUMN_A
See Also:
Constant Field Values

WHITE_COLUMN_B

public static final int WHITE_COLUMN_B
See Also:
Constant Field Values

WHITE_COLUMN_C

public static final int WHITE_COLUMN_C
See Also:
Constant Field Values

WHITE_COLUMN_D

public static final int WHITE_COLUMN_D
See Also:
Constant Field Values

WHITE_COLUMN_E

public static final int WHITE_COLUMN_E
See Also:
Constant Field Values

WHITE_COLUMN_F

public static final int WHITE_COLUMN_F
See Also:
Constant Field Values

WHITE_COLUMN_G

public static final int WHITE_COLUMN_G
See Also:
Constant Field Values

WHITE_COLUMN_H

public static final int WHITE_COLUMN_H
See Also:
Constant Field Values

BUFFER2

public static final int BUFFER2
The index for the column structure grouping for white.

See Also:
Constant Field Values

BLACK_COLUMN_A

public static final int BLACK_COLUMN_A
See Also:
Constant Field Values

BLACK_COLUMN_B

public static final int BLACK_COLUMN_B
See Also:
Constant Field Values

BLACK_COLUMN_C

public static final int BLACK_COLUMN_C
See Also:
Constant Field Values

BLACK_COLUMN_D

public static final int BLACK_COLUMN_D
See Also:
Constant Field Values

BLACK_COLUMN_E

public static final int BLACK_COLUMN_E
See Also:
Constant Field Values

BLACK_COLUMN_F

public static final int BLACK_COLUMN_F
See Also:
Constant Field Values

BLACK_COLUMN_G

public static final int BLACK_COLUMN_G
See Also:
Constant Field Values

BLACK_COLUMN_H

public static final int BLACK_COLUMN_H
See Also:
Constant Field Values

BUFFER3

public static final int BUFFER3
See Also:
Constant Field Values

WHITE_PAWN_ISLANDS

public static final int WHITE_PAWN_ISLANDS
The index for the pawn island count feature for white.

See Also:
Constant Field Values

BLACK_PAWN_ISLANDS

public static final int BLACK_PAWN_ISLANDS
The index for the pawn island count feature for black.

See Also:
Constant Field Values

WHITE_ISOLANIS

public static final int WHITE_ISOLANIS
The index for the isolated pawns (isolani) feature for white.

See Also:
Constant Field Values

BLACK_ISOLANIS

public static final int BLACK_ISOLANIS
The index for the isolated pawns (isolani) feature for black.

See Also:
Constant Field Values

WHITE_SPACE

public static final int WHITE_SPACE
The index for the space count feature for white.

See Also:
Constant Field Values

BLACK_SPACE

public static final int BLACK_SPACE
The index for the space count feature for black.

See Also:
Constant Field Values

WHITE_PASSED_PAWNS

public static final int WHITE_PASSED_PAWNS
The index for the passed pawn feature for white.

See Also:
Constant Field Values

BLACK_PASSED_PAWNS

public static final int BLACK_PASSED_PAWNS
The index for the passed pawn feature for black.

See Also:
Constant Field Values

WHITE_DOUBLED_PAWNS

public static final int WHITE_DOUBLED_PAWNS
The index for the doubled pawn feature for white.

See Also:
Constant Field Values

BLACK_DOUBLED_PAWNS

public static final int BLACK_DOUBLED_PAWNS
The index for the doubled pawn feature for black.

See Also:
Constant Field Values

WHITE_KING_SHIELD

public static final int WHITE_KING_SHIELD
The index for the king shield feature for white.

See Also:
Constant Field Values

BLACK_KING_SHIELD

public static final int BLACK_KING_SHIELD
The index for the king shield feature for black.

See Also:
Constant Field Values

WHITE_KING_TROPISM

public static final int WHITE_KING_TROPISM
The index for the king tropism value for white.

See Also:
Constant Field Values

BLACK_KING_TROPISM

public static final int BLACK_KING_TROPISM
The index for the king tropism value for black.

See Also:
Constant Field Values

features

public java.lang.String[] features
The container for the evaluative strings.

Constructor Detail

ESFramework

public ESFramework(Position p)
Constructor: This creates the necessary tools for the framework's existence. Feature construction and recognition can take place without any additional parameters.

Parameters:
p - The position to evaluate.
Method Detail

material

public void material()
Generates the material imbalance between the two sides and stores it in the appropriate index. The format is [numberofpieces][short-hand piece type], separated by spaces. Note that the string begins with a space so that the result is not confused with the null string if material is even.


bishopvknight

public void bishopvknight()
Detects whether the bishop or knight imbalance is present and stores it in the appropriate index. The string will be w if the bishop is on white's side, b if the bishop is on black's side, or n if the imbalance is not present.


twobishops

public void twobishops()
Detects whether each side has a pair of bishops and stores it in the appropriate index. The string will be "w " if white has the pair but black does not, " b" if black has the bishop pair but white does not, "wb" if both players have the bishop pair, and "n" if neither player has the bishop pair.


oppositebishops

public void oppositebishops()
Detects whether a situation with opposite coloured bishops (1 bishop each, but one is on a dark square, but its adversary on a white square) is present and stores it in the appropriate index. "y" will be stored if the situation exists, "n" otherwise.


columnstruct

public void columnstruct()
Organises the pawns into structure by column and stores them into the appropriate index. This is a time-saving call for some of the pawn structure related strings in this class.


pawnislands

public void pawnislands()
Determines the number of pawn islands present in the pawn structure and stores them in the appropriate indices.


isolani

public void isolani()
Determines the column of the isolanis present in the pawn structure and stores them in the appropriate indices. (Note: Columns are stored in 0x88 numbers from 0-7 inclusive)


space

public void space()
Determines the space enclosed by the pawn structure for both sides and stores them in the appropriate indices.


passpawn

public void passpawn()
Determines the column of the passed pawns present in the pawn structure for both sides and stores them in the appropriate indices. (Note: Columns are stored in 0x88 numbers from 0-7 inclusive)


doublepawn

public void doublepawn()
Determines the columns where the double pawns are present in the pawn structures for both sides and stores them in the appropriate indices. (Note: Columns are stored in 0x88 numbers from 0-7 inclusive).


kingshield

public void kingshield()
Determines the king's "pawn shield" as a weighted average for both sides and stores them in the appropriate indices.


kingtropism

public void kingtropism()
Determines the average distance from the opposing side's pieces to each player's king and stores them in the appropriate indices.