A system that uses the concept of artificial intelligence will provide output in the form of a solution to a problem based on the existing body of knowledge.
Fig. System Schematic Using Artificial Intelligence
In the image above, the input given to the artificial intelligence system is in the form of a problem. The system must be equipped with a set of knowledge embedded in the knowledge base. The system must also have an Inference Motor to be able to draw conclusions based on facts or knowledge. The output of the inference is in the form of a solution.
Methods of Presenting State Space
In general, there are 4 things that need to be considered in building an Expert System or Artificial Intelligence, including:
- Defining the problem precisely. This definition includes precise specifications of the initial state and the desired solution.
- Analyze the problem and look for several appropriate problem solving techniques.
- Represents the knowledge necessary to solve the problem.
- Choose the best problem solving technique.
In this material, we will thoroughly examine point 1 first. Suppose the problem faced is a chess game, then it must be determined:
1. Starting position on the chessboard
The starting position of every chess game is always the same, namely all the pieces are placed on the chessboard on 2 sides, namely the white camp and the black camp.
2. Rules for performing movements
These rules are very useful for determining the movement of a piece, namely moving from one state to another. For example, to make it easier to show the position of the piece, each box is indicated by a letter (a, b, c, d, e, f, g, h) for the horizontal direction and a number (1, 2, 3, 4, 5, 6, 7, 8) for the vertical direction. A rule for moving a piece from position (e, 2) to (e, 4) can be shown by the rule:
if bidak putih pada kotak(e,2),
and kotak(e,3) kosong,
and kotak(e,4) kosong
then gerakan bidak dari (e,2) ke (e,4)
3. Goal
The goal to be achieved is a position on the chessboard that indicates a person's victory over his opponent. This victory is marked by the position of the king who can no longer move.
The example shows the representation of the problem in State Space, which is a space containing all possible states.
We can start playing chess by placing ourselves in the initial state, then moving from one state to another according to the existing rules, and ending the game if one has achieved the goal.
So to describe the problem well you must:
- Defining a state space
- Set one or more initial states
- Set one or more goals (goal states)
- Define a set of rules
Some ways to represent State Space include:
1. State Graph
The graph consists of nodes that show the state, namely the initial state and the new state that will be achieved using operators. The nodes in the state graph are connected to each other using arcs with arrows to show the direction from one state to the next.
Gb. Graph Condition
State graph with node M showing the initial state, node T is the goal. There are 4 paths from M to T:
- MABCET
- MABCEHT
- MDCET
- MDCEHT
Dead end or a path that does not reach the destination:
- MABCEFG
- MABCEIJ
- MDCEFG
- MDCEIJ
- MDIJ
2. Tracking / Search Tree
Tree structures are used to describe hierarchical states. The node located at level -0 is called the "root".
Root node: shows the initial state & has several branches consisting of several nodes called "children".
Nodes that have no children are called "leaves". They indicate the end of a search, either a desired goal or a dead end.
The following figure shows a search tree for a state graph with 6 levels.
Fig. Tracking Tree
3. AND/OR tree
Problem M is solved with 4 possibilities, namely A OR B OR C OR D.
Gb. OR Tree
Problem M can only be solved with A AND B AND C AND D.
AND Tree Image
Example 1:
By using AND/OR tree the goal achieved in the previous figure (tracking tree) can be shortened to level-2 only.
Fig. AND/OR Tree
Example 2:
Problems of FARMERS, GOATS, WOLVES, VEGETABLES, BOATS.
A farmer will take a goat, a wolf, and a vegetable across a river by boat. The boat can only accommodate the farmer and one other passenger (goat, wolf, or vegetable). If the farmer leaves, the vegetable will be eaten by the goat and the goat will be eaten by the wolf.
Solution:
1. Identify the state space
This problem can be symbolized by (number of goats, number of wolves, number of vegetables, number of boats).
Example: area of origin (0,1,1,1) = area of origin there are no goats, there are wolves, there are vegetables, there are boats
2. Initial state & goals
Initial conditions, in both areas:
area of origin = (1,1,1,1)
area of opposite = (0,0,0,0)
The destination state, in both areas:
area of origin = (0,0,0,0)
area of opposite = (1,1,1,1)
3. Rules
4. Solution Found
TASK - Complete the River IQ Game
https://09218570182764394787.googlegroups.com/attach/17f62b95ccd26/riverIQGame.swf
Completion
https://drive.google.com/file/d/0B2Kobfk0fxx9R0pUazFHY2FqM00/view?usp=sharing
Netizens
Q1: GRACE SELLA PURBA 7 Oct 2016, 09:08:00 = How do I download the application, bro?
A1: Hi Grace Sella, you can open the FORUM menu >> then enter the following title "Completing the River Game Logic" in the forum search box, there we attach the file.