-
Notifications
You must be signed in to change notification settings - Fork 0
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
Todays work #16
Comments
Problems and corrections Checking additional removals For Piece positionb2 X, Y (1, 1) wP b2PAWNName P Position a3 is missing WhitePawn2 Attacking a3 Color B Piece None false gamepiece Gamenone Checking additional removals For Piece positionb2 X, Y (1, 1) wP b2PAWNName P |
Create rules for preferable positions for a piece. Examples of preferable pieces (and preferable action): DONE: |
The chessdomain predicates: Propositional symbols: ACTION = "ACTION"; OWNER = "OWNER"; - Only used as predicate symbol The following questions must be answered: RULES: At present (17.12.20) are the following rules avaiable: A possible rule: A more enhanced rule: |
Work to do: When creating terms for a predicate (Sentence) we must specify what terms are Constants and what terms are Variables !!! A piece that has recently been moved must not be considered. To choose the best chess action as a planning problem. Examples of sentences for the init state: With the initial state and the goal state defined, we then create a number of ActionSchemas (aima.core.logic.planning.ActionSchema). Parameters that determine the structure of the Problem, and the states: Procedure to build a goal state: |
Chess engines: Create a chess engine based on first-order logic. We define this as a JOB (an Act see chapter 11.2 p. 406): (A hierarchical task network planning - HTN - with a High-level action (HLA)) A plan for: To capture the opponent king A chess action has a name (the piece name) and a number. An example solution from the graphplan algorithm: When removing the reachable predicate from the preconditions of the TYPE actionschema: The fluents of Initial state. They are nodes in S0 The following file contains results from solving the planning problem for all available actions 22.12.20 https://app.zenhub.com/files/137453363/5c768e25-4e54-4d82-b34a-9714f39e94f1/download |
ActionSchemas and Problems: The fluents the goal state Each chess action has an action name and a number. Possible solutions: One Problem may contain one or more Action Schemas. |
A game 18.05.21 Check the methods that find opponent pieces that can be taken. |
Given the following position: From the knowledge base, the following positions are threatened by the blackbishop1: If we move Whiteknight2, then the white queen can be taken. Similar for black queen and black rook 2: This is not correct. See available positions: Piece position d8 X, Y (3, 7) bQ d8 QUEEN ActiveName Q |
28.05.21:
The OpponentmoveProcessor must be reworked!
Check the PreferredmoveProcessor.
Must create actions for opponent
We have a set of chess actions that are available to choose from.
We need a strategy to choose the right chess action from the set of available chess actions.
To choose the best chess action we use Planning as described in chapter 10 and 11 of the AIMA book.
We need to create an initial state and a goal state (aima.core.logic.planning.State)
Both the initial state and the goal state contains a set of conjunctions of ground atoms (literals).
The conjunction sentence is split into its ground literals. (See the Utils class under planning)
The literals may contain variables.
Examples of sentences for the init state:
occupies(WhitePawn8,h2) AND OWNER(WhitePlayer,WhitePawn8)AND REACHABLE(WhitePawn8,h3)
occupies(WhitePawn8,h2) AND OWNER(WhitePlayer,WhitePawn8)AND REACHABLE(WhitePawn8,h4)
PROTECTEDBY(WhitePawn7,h3) AND OWNER(WhitePlayer,WhitePawn7)
Examples of sentences for the goal state:
occupies(WhitePawn8,h3) AND OWNER(WhitePlayer,WhitePawn8)
Each of these states is represented by a conjunction of fluents. A fluent is a Literal (aima.core.logic.fol.kb.data.Literal).
A fluent is a ground functionless atom: occupies(WhitePawn8,h2)
It is a relation or function that can vary from one situation (state) to the next. (p. 388).
With the initial state and the goal state defined, we then create a number of ActionSchemas (aima.core.logic.planning.ActionSchema).
The actionschemas represents actions. So the actions and the states become part of the Problem (aima.core.logic.planning.Problem)
The schema consists of the action name, a list of all the variables used in the schema, a precondition and an effect.
The precondition and effect are also represented as a conjunction of fluents.
The name given to the actionschema is the same name as given to the chess action:
WhitePawn6_0. which in this case means move WhitePawn6 and it is the 0 move in the sequence of moves.
All the available chess actions are possible to perform. The planning problem consists of finding which chess action to perform.
All chess actions have an equivalent action schema.
We need to find a strategy such that we choose the "correct" actions schema ( and chess action) to perform
We have the following parameters available:
The number of this move.
The name of the chess pieces and the name of the chess actions.
The positions of the opponent pieces.
What reachable positions are protected.
What reachable positions are threatened by opponent pieces.
What opponent pieces can be taken.
An observation: If the HLA is given a number of action schemas and an initial and goal state that belongs to one of the action schemas.
the hierarchical search function returns with the first action in the list.
How to create an (HLA) Action schema so that the Problem Solver chooses the "correct" chess action?
Examples of moves so far:
The text was updated successfully, but these errors were encountered: