In the first post on this blog in the AI category we briefly looked at a basic AI framework that we adapt in various situations to help us achieve all sorts of different types of solutions to our problems depending on what type of problem we have, what our goal is and the information we have to hand when we begin planning out our software.

In this post we’re going to take that same framework and disect the operations of it even further to get a better feel for what is going on when we apply it in the real world. Understanding it at this deep level will allow for additional principles (more advanced methods) to be easily digested and applied when we come accross them.

The first line we come accross in the algroithms pseudocode is this idea of initialising and clearing out some sort of working memory for the system.

Set WorkingMemory = Empty

Once we’ve defined and cleared out our working memory then next step is to run a function that initialises (generates) our candidate solution (one of our test candidates)

CandidateSolution = Generate(Node)

Once we have a test candidate or “candidate solution” the next step is to test it.

Result = Test(CandidateSolution)

Once the test has been completed and a result is known that answer can be stored to the working memory to inform future searches if we so wish.

UpdateWorkingMemory(Result)

In our code we can implement a loop that continuously generates new candidate solutions, tests them and then stores them to memory until a solution is found (the same process as described above repeated over and over again).

 While (goal_not_found AND possibilities_left) DO
      CandidateSolution = Generate(Node)
      Result = Test(CandidateSolution)
      UpdateWorkingMemory(Result)
 OD // End while loop.

Once a solution is found the program returns the result. The quality of which will depend on all of the factors of the problem and which method we chose to solve the problem depending on these factors.

 Return // Success or failure as appropriate.

This is the very basic AI framework broken down step by step for us to observe the behaviour of the software. The next step would be to learn how to adapt the behaviour of this algorithm by further informing our method with data that we’ve already assessed and saved to our “we’ve checked these places” list (that data that builds the picture of our map). The next post you should read is called Breadth Vs Depth-First Search” because it gives a good introduction to the concept.

Reference: Information for this post was collected from lecture notes of a lecture written by Jim Smith who is a Professor in Interactive Artificial Intelligence (AI) in the Department of Computer Science and Creative Technologies at the University of the West of England.

Leave a Comment

Your email address will not be published. Required fields are marked *