olufjen / chess

Programs to utilize chess ontologies, and play games of chess
1 stars 0 forks source link

Planning strategies part 3 (from week 32) #31

Open olufjen opened 3 years ago

olufjen commented 3 years ago

The game system contains two knowledgebases: One parent KB and a Strategy KB. The strategy KB contains knowledge about possible movements from available posistions: occupies(WhiteRook2,g1) REACHABLE(WhiteRook2_g1,h1) REACHABLE(WhiteRook2_g1,f1) occupies(WhiteRook2,f1) REACHABLE(WhiteRook2_f1,h1) REACHABLE(WhiteRook2_f1,g1)

Create a class Performance that is responsible for calculating the performance measure.

olufjen commented 3 years ago

Tasks: Rebuild the ChessFolKnowledgebase to be used for all knowledgebases. Move all possible inference methods to this class. Create a Performance class to contain and maintain the performance measure: Part of a performance measure: The number of pieces that protect a position. The rank of these pieces. Can I take any opponent piece with a given move (from a given position?)

olufjen commented 3 years ago

All available positions after the closest opponent piece must be put in the removed list. This is not applicable for Knights and pawns.

olufjen commented 3 years ago

The PreferredMove processor must be reworked: Checks the removed positions!!: Piece name WhiteBishop1: This is found in file preferredmoveB13!! rnbq1rk1/ppp11pp1/111b1n1p/111p1111/111P1111/11NBPN11/PP111PPP/R1BQ1RK1 Piece position c1 X, Y (2, 0) wB c1 BISHOP ActiveName B Available positions Position: b2 B X, Y (1, 1) Occupied by: WhitePawn2 Position: a3 B X, Y (0, 2) Position: d2 B X, Y (3, 1) Position: e3 B X, Y (4, 2) Occupied by: WhitePawn5 Position: f4 B X, Y (5, 3) Position: g5 B X, Y (6, 4) Position: h6 B X, Y (7, 5) Occupied by: BlackPawn8: This position is not removed!!! This is because it contains an opponent piece Removed positions Position: b2 B X, Y (1, 1) Occupied by: WhitePawn2 Position: e3 B X, Y (4, 2) Occupied by: WhitePawn5 Position: a3 B X, Y (0, 2) Position: f4 B X, Y (5, 3) Position: g5 B X, Y (6, 4) Position: d2 B X, Y (3, 1) Northwest positions X, Y (1, 1) X, Y (0, 2) Northeast positions X, Y (3, 1) X, Y (4, 2) X, Y (5, 3) X, Y (6, 4) X, Y (7, 5) Southeast positions

olufjen commented 3 years ago

From the example game: We must find the min position in all directions. For white bishop 1 at c1: The min position is b2 in NW direction, but the min position in NE direction is e3. The procedure for finding all removed positions for Bishop is moved to the ABishop class

olufjen commented 3 years ago

See above comment: Make similar procedures for the ARook class and the AQueen class

olufjen commented 3 years ago

OBS: In the recordings of preferred moves for each piece: The positions of friendly pieces are correct after the next move by the opponent.

olufjen commented 3 years ago

After rework of PreferredMove processor: whiterook

This is now solved: The PreferredMoveProcessor has been reworked.