Okay!!! So before diving into deeper in the forest of AI, let us understand some basic terminologies
like what is problem, problem characteristics, state space, etc. This might seem little boring to
you but we need to discuss about these terminologies to proceed further. So I'll quickly give you
the idea about what they are :
A problem consists of four parts-
1. Initial state(s)
2. Set of actions
3. Goal test function
4. Path cost function
A state space comprised of all feasible state corresponding to the problem.
Solution may be a path from initial state to goal state incorporating various intermediate
states.
The characteristics of problem are :
1. Is the problem decomposable?
2. Can solution steps be ignored or undone ?
3. Is the problem universe predictable?
4. Is a good solution must, without comparing all other solutions ?
5. Is the desired solution a path to a state or simply a state?
Now, the important topic starts from here. Every problem must be solved using a system.
It is one of the very basic necessities of AI to solve a problem.
To build a system that can solve the problem must follow these :
1. Precise problem definition & specification of states
2. Analysis of important features
3. Isolate & represent task-knowledge
4. Choose the best problem solving techniques & apply it.
A system that solves a problem in AI is known as a Production System.
Describing & performing the search process during goal state determination will be done
by the production system. It consists of-
1. A set of rule : A set of do(s) and don't(s).
2. Database/knowledgebase : A collection of data or knowledge.
3. Control strategy : The control flow of the program for the solving the problem.
4. Rule applier : As the name implies, it applies the appropriate rule to the system.
A little more description about Control Strategy :
A good control strategy may ensure a goal state with
comparatively reasonable path cost. Two of its features are vital
1. Dynamic : will ensure newer and newer state only to enhance possibility of obtaining a goal state.
2. Systematic : this feature will drive it into either of the solution paths through least effort.
For simplicity, here we will take the example of Water Jug Problem for the better understanding of Production System.
Water Jug Problem
Two jugs of size 7 and 4 gallons and one liquid source with enough amount can be availed. The
container contains no scaling on them. Container can be filled, emptied or exchange liquid
between themselves. Perform operation in such an way that 7 gallon jug contains 2 gallon of water.
Production Rule :
1. (x,y) -> (x,4) Fill-up the 4-gallon Jug from Water Source.
if(y<4)
2. (x,y) -> (7,y) Fill-up the 7-gallon Jug from Water Source.
if(x<7)
3. (7,y) -> (7-(4-y),4) Fill-up the 4-gallon Jug from the 7-gallon Jug.
if(y<4)
4. (x,4) -> (7,4-(7-x)) Fill-up the 7-gallon Jug from the 4-gallon Jug.
if(x<7) && (x>2)
etc.
Knowledge Base :
7-gallon Jug
4-gallon Jug
Water Source
Control Strategy :
This problem can be solved in many ways. A small part of the search tree or graph will help you to visualise the different possibilities. But not all the possibilities will be followed. Only the path with the least effort will be taken.
Rule Applier :
x y Rule / Operation
0 0 Initial state
7 0 Fill-up the 7 gallon jug from the water source
3 4 Fill 4g jug from 7g jug
3 0 Empty the 4g jug
0 3 Fill 4g jug from 7g jug
7 3 Fill-up the 7g jug from the water source
6 4 Fill 4g jug from 7g jug
6 0 Empty the 4g jug
2 4 Fill 4g jug from 7g jug
In this way, this problem can be solved with the least effort.
Here is a small video for the solution.
like what is problem, problem characteristics, state space, etc. This might seem little boring to
you but we need to discuss about these terminologies to proceed further. So I'll quickly give you
the idea about what they are :
A problem consists of four parts-
1. Initial state(s)
2. Set of actions
3. Goal test function
4. Path cost function
A state space comprised of all feasible state corresponding to the problem.
Solution may be a path from initial state to goal state incorporating various intermediate
states.
The characteristics of problem are :
1. Is the problem decomposable?
2. Can solution steps be ignored or undone ?
3. Is the problem universe predictable?
4. Is a good solution must, without comparing all other solutions ?
5. Is the desired solution a path to a state or simply a state?
Now, the important topic starts from here. Every problem must be solved using a system.
It is one of the very basic necessities of AI to solve a problem.
To build a system that can solve the problem must follow these :
1. Precise problem definition & specification of states
2. Analysis of important features
3. Isolate & represent task-knowledge
4. Choose the best problem solving techniques & apply it.
A system that solves a problem in AI is known as a Production System.
Describing & performing the search process during goal state determination will be done
by the production system. It consists of-
1. A set of rule : A set of do(s) and don't(s).
2. Database/knowledgebase : A collection of data or knowledge.
3. Control strategy : The control flow of the program for the solving the problem.
4. Rule applier : As the name implies, it applies the appropriate rule to the system.
A little more description about Control Strategy :
A good control strategy may ensure a goal state with
comparatively reasonable path cost. Two of its features are vital
1. Dynamic : will ensure newer and newer state only to enhance possibility of obtaining a goal state.
2. Systematic : this feature will drive it into either of the solution paths through least effort.
For simplicity, here we will take the example of Water Jug Problem for the better understanding of Production System.
Water Jug Problem
Two jugs of size 7 and 4 gallons and one liquid source with enough amount can be availed. The
container contains no scaling on them. Container can be filled, emptied or exchange liquid
between themselves. Perform operation in such an way that 7 gallon jug contains 2 gallon of water.
Production Rule :
1. (x,y) -> (x,4) Fill-up the 4-gallon Jug from Water Source.
if(y<4)
2. (x,y) -> (7,y) Fill-up the 7-gallon Jug from Water Source.
if(x<7)
3. (7,y) -> (7-(4-y),4) Fill-up the 4-gallon Jug from the 7-gallon Jug.
if(y<4)
4. (x,4) -> (7,4-(7-x)) Fill-up the 7-gallon Jug from the 4-gallon Jug.
if(x<7) && (x>2)
etc.
Knowledge Base :
7-gallon Jug
4-gallon Jug
Water Source
Control Strategy :
This problem can be solved in many ways. A small part of the search tree or graph will help you to visualise the different possibilities. But not all the possibilities will be followed. Only the path with the least effort will be taken.
Rule Applier :
x y Rule / Operation
0 0 Initial state
7 0 Fill-up the 7 gallon jug from the water source
3 4 Fill 4g jug from 7g jug
3 0 Empty the 4g jug
0 3 Fill 4g jug from 7g jug
7 3 Fill-up the 7g jug from the water source
6 4 Fill 4g jug from 7g jug
6 0 Empty the 4g jug
2 4 Fill 4g jug from 7g jug
In this way, this problem can be solved with the least effort.
Here is a small video for the solution.
can i get the code for this simulation for reference?
ReplyDeletecould i get the source code for this , i'm very curious to know how you achieved this output
ReplyDelete