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

Game strategies from week 30 22 #49

Open
olufjen opened this issue Jul 27, 2022 · 5 comments
Open

Game strategies from week 30 22 #49

olufjen opened this issue Jul 27, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@olufjen
Copy link
Owner

olufjen commented Jul 27, 2022

When creating an Action Schema
can we change
Constant piece = new Constant(pieceName);
Constant pos = new Constant(posName);
Constant toPos = new Constant(toPosit);
List variables = new ArrayList(Arrays.asList(piece,pos,toPos));
to :
Variable piece = new Variable("piece");
Variable frompos = new Variable("from");
Variable topos = new Variable("to");
List variables = new ArrayList(Arrays.asList(piece,pos,toPos));
and then:
ActionSchema movedAction = new ActionSchema(actionName,variables,precondition,effects);
But then the preconditions and effects must also contain the same Variables.
This would represent one general Action Schema for all Action Schemas represented in the Problem

17.08.22:
These points have been done.
The castling move needs to be reworked.
Create a new Action schema based on the castling move.
(King to g1, Castle to f1, King to c1 Castle to d1)

@olufjen olufjen added the enhancement New feature or request label Jul 27, 2022
@olufjen
Copy link
Owner Author

olufjen commented Jul 27, 2022

An action schema is applicable in a state s if the preconditions are satisfied by s.
An action a can be executed in state s if s entails the precondition of a. (p. 368)
(Also read p. 375.)
The initial state (state s) may contain more fluents than the precondition.
The initial state may only contain ground atoms ( no variables or functions).

@olufjen
Copy link
Owner Author

olufjen commented Aug 2, 2022

04.08.22:This problem has now been fixed:
A game 02.08.22:
The CASTLE predicate must be declared in the precondition!!
1 d4 d5
2 c4 Nf6
3 Nc3 e6
4 Nf3 Bd6
5 cxd5 exd5
6 e3 o-o
7 Bd3 h6
8 Bd2
game020822.PNG

The bishop is moved instead of king
The fluents of end outcome contains in addition to init state:
occupies(WhiteKing,e2)
PIECETYPE(WhiteKing,KING)
occupies(WhiteKing,f1)
PIECETYPE(WhiteKing,KING)
occupies(WhiteKing,d2)
PIECETYPE(WhiteKing,KING)
occupies(WhiteKing,e2)
PIECETYPE(WhiteKing,KING)
occupies(WhiteKing,e2)
PIECETYPE(WhiteKing,KING)
The fluents of goal state:

The game after the bug fix:
1 d4 d5
2 c4 Nf6
3 Nc3 e6
4 Nf3 Bd6
5 cxd5 exd5
6 e3 o-o
7 Bd3 h6
8 o-o Nc6
9 Qb3 Be6
10 Nxd5 Nxd5
11 Qxb7 Bd7
12 Qa6 -

@olufjen
Copy link
Owner Author

olufjen commented Aug 27, 2022

27.08.22 Solved 27.08.22
Caused by: java.lang.NullPointerException
at no.chess.web.model.game.AChessProblemSolver.prepareAction(AChessProblemSolver.java:747)
at no.chess.web.model.game.AChessProblemSolver.checkMovenumber(AChessProblemSolver.java:1011)
at no.chess.web.model.game.AChessProblemSolver.planProblem(AChessProblemSolver.java:1125)
at no.chess.web.model.game.AChessAgent.execute(AChessAgent.java:469)
at no.chess.web.model.PlayGame.proposeMove(PlayGame.java:305)
1 d4 d5
2 c4 Nf6
3 Nc3 e6
4 Nf3 Bd6
5 cxd5 exd5
6 e3 o-o
7 Bd3 h6
8 o-o Nc6
9 Qb3 b6
10 Nxd5 Nxd5
11 Qxd5 Be6
12 Qb5 a6
13 Qxc6 f5
14 Bc2

@olufjen
Copy link
Owner Author

olufjen commented Aug 29, 2022

Corrected!!
Action(WhitePawn5_d4)
PRECOND:^occupies(WhitePawn5,e3)^REACHABLE(WhitePawn5,d4)^PIECETYPE(WhitePawn5,PAWN)
EFFECT:^occupies(WhitePawn5,d4)^PIECETYPE(WhitePawn5,PAWN)
The above action schema must be changed to PAWNATTACK(WhitePawn5,d4)

@olufjen
Copy link
Owner Author

olufjen commented Sep 12, 2022

At this stage of the game:
The opponent King is checked!!
1 d4 d5
2 c4 Nf6
3 Nc3 e6
4 Nf3 Bd6
5 cxd5 exd5
6 e3 o-o
7 Bd3 h6
8 o-o Nc6
9 Qb3 a6
10 Nxd5 Nxd5
11 Qxd5 Be6
12 Qe4 f5
13 Qxe6 Rf6 - An illegal move !!
14 Qd5 -

check.PNG

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