Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Until week 32 (August 9) Planning strategies part 2 #30

Open
olufjen opened this issue Jul 5, 2021 · 4 comments
Open

Until week 32 (August 9) Planning strategies part 2 #30

olufjen opened this issue Jul 5, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@olufjen
Copy link
Owner

olufjen commented Jul 5, 2021

The full knowledge base contains the
occupies(WhiteBishop2,d3), - the position the bishop currently occupies
while the temporary knowledge base contains
occupies(WhiteBishop2,e2)
REACHABLE(WhiteBishop2e2,g4)
REACHABLE(WhiteBishop2e2,h5)
REACHABLE(WhiteBishop2e2,d3)
REACHABLE(WhiteBishop2e2,c4)
REACHABLE(WhiteBishop2e2,b5)
REACHABLE(WhiteBishop2e2,a6)
occupies(WhiteBishop2,e4)

  • all the positions this bishop may occupy in the next move, and which positions are reachable from these new positions.
    The temporary knowledge base also contains the positions the opponent pieces occupy and where they may move to.
    Then the chooseStrategy method must find the next possible best move based on these facts.
    The player has a set of possible actions available.
    Given the piecename of this action, then
    check which positions this piece can occupy, check which positions are reachable from this new position.
    Then check any opponent pieces that can be taken by this piece given its reachable positions and what positions the opponent pieces are occupying.

Given the planning strategies of week 26:
Then find which opponent pieces I can take.
And find which of my own pieces I protect

@olufjen olufjen changed the title Week 27 (July 5) Planningh strategies part 2 Week 27 (July 5) Planning strategies part 2 Jul 5, 2021
@olufjen olufjen added the enhancement New feature or request label Jul 5, 2021
@olufjen
Copy link
Owner Author

olufjen commented Jul 10, 2021

The bug behind this comment has been corrected. (02.08.21)
The knowledge base for Whitebishop2:
occupies(WhiteBishop2,e2)
REACHABLE(WhiteBishop2e2,c4)
REACHABLE(WhiteBishop2e2,b5)
REACHABLE(WhiteBishop2e2,a6)
REACHABLE(WhiteBishop2e2,f1)
REACHABLE(WhiteBishop2e2,f3)
REACHABLE(WhiteBishop2e2,g4)
REACHABLE(WhiteBishop2e2,h5)
REACHABLE(WhiteBishop2e2,d1)
REACHABLE(WhiteBishop2e2,d3)

From probepossebilities and choose strategy:
WhiteBishop2e2f3
f3 Color W Piece no.chess.web.model.ChessPiece Ontology name WhiteKnight2
Chesspiece position f3
Piece active: true true gamepiece null

WhiteBishop2e2g4
g4 Color W Piece None false gamepiece Gamenone

WhiteBishop2e2h5
h5 Color W Piece no.chess.web.model.ChessPiece Ontology name BlackPawn8
Chesspiece position h5
Piece active: true true gamepiece null

WhiteBishop2e2d1
d1 Color W Piece no.chess.web.model.ChessPiece Ontology name WhiteQueen
Chesspiece position d1
Piece active: true true gamepiece null

WhiteBishop2e2d3
d3 Color W Piece no.chess.web.model.ChessPiece Ontology name WhiteBishop2
Chesspiece position d3
Piece active: true true gamepiece null

WhiteBishop2e2c4
c4 Color W Piece None false gamepiece Gamenone

WhiteBishop2e2b5
b5 Color W Piece None false gamepiece Gamenone

This produces wrong results because we are using an existing action.
We need to create a new action for every new probe.

@olufjen olufjen changed the title Week 27 (July 5) Planning strategies part 2 Until week 32 (August 9) Planning strategies part 2 Jul 19, 2021
@olufjen
Copy link
Owner Author

olufjen commented Aug 4, 2021

To find a strategy for this game:
chessstrategy

The game possesses two KB. One parent KB and one strategy KB.
Can I move pawn 4 or 5?
Are they protected? By what piece and how many? (Parent KB)
Are they threatened? By what piece and how many? (Parent KB)

@olufjen
Copy link
Owner Author

olufjen commented Aug 5, 2021

Solved:
The positions f4,f5,f6,f7,f8 should have been removed:

occupies(WhiteRook2,f1)
REACHABLE(WhiteRook2_f1,h1)
REACHABLE(WhiteRook2_f1,g1)
REACHABLE(WhiteRook2_f1,f4)
REACHABLE(WhiteRook2_f1,f5)
REACHABLE(WhiteRook2_f1,f6)
REACHABLE(WhiteRook2_f1,f7)
REACHABLE(WhiteRook2_f1,f8)

@olufjen
Copy link
Owner Author

olufjen commented Aug 5, 2021

Solved:
For whiterook2 in position f1:
Piece position f1 X, Y (5, 0) wR f1 ROOK ActiveName R
Available positions
Position: h2 B X, Y (7, 1) Occupied by: WhitePawn8
Position: g2 W X, Y (6, 1) Occupied by: WhitePawn7
Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2
Position: f3 W X, Y (5, 2) Occupied by: WhiteKnight2
Position: e2 W X, Y (4, 1)
Position: f4 B X, Y (5, 3)
Position: d2 B X, Y (3, 1)
Position: f5 W X, Y (5, 4)
Position: c2 W X, Y (2, 1)
Position: f6 B X, Y (5, 5) Occupied by: BlackKnight2
Position: b2 B X, Y (1, 1) Occupied by: WhitePawn2
Position: f7 W X, Y (5, 6) Occupied by: BlackPawn6
Position: a2 W X, Y (0, 1) Occupied by: WhitePawn1
Position: f8 B X, Y (5, 7) Occupied by: BlackRook2
Removed positions
Position: h2 B X, Y (7, 1) Occupied by: WhitePawn8
Position: g2 W X, Y (6, 1) Occupied by: WhitePawn7
Position: f3 W X, Y (5, 2) Occupied by: WhiteKnight2
Position: b2 B X, Y (1, 1) Occupied by: WhitePawn2
Position: a2 W X, Y (0, 1) Occupied by: WhitePawn1
Position: f4 B X, Y (5, 3)
Position: f5 W X, Y (5, 4)
Position: f6 B X, Y (5, 5) Occupied by: BlackKnight2
Position: f7 W X, Y (5, 6) Occupied by: BlackPawn6
Position: f8 B X, Y (5, 7) Occupied by: BlackRook2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant