HOME
III - Making a decision
Analyzing input
When you have all the input you need, it’s time for the bot to make a decision. Most tasks are probably quite simple and can be handled using a few if-statements. While some require advanced algorithms to decide the bots action. When the bot is to simulate human behavior, or when playing a highly sofisticated game like texas holdem for instance.
To be able to handle a large number of different cases or states one can use action tables or decision charts.
Decision charts
Using the above mentioned example of a bot playing poker, we can develop a decision chart as depicted below.

This kind of decision chart takes in the number of players you face, your chance of winning, what the cost to check or raise is and in what position you are in at the table.
As you can see in this specific chart, where you happen to be in middle position and the bet is one Big Blind, if you are playing 3 opponents and the bot calculates your chance of winning to 85% the action would be to raise.
These type of charts can be developed for bots with a large number of known states. It can easily be incorporated as a separate file where different characters in different positions have different meanings.
Advanced decision making processes
In some cases it might not be so easy to define a set of known states. It could be that you do not know the relation between the input variables to form the decision algorithm.
If you do have a set of historically correct output values for known input values you can create an algorithm using neural networks. A great way of using NNs is to utilize FANN (Fast Artificial Neural Networks) which is a free liberary available in a wide variety of languages. You do not need to have any deeper understanding of the inner workings of the NNs, you can just use the libs as they are. The drawback with this method is that to be accurate you have to have a very large set of previous values to be able to "teach" your NN. More on NNs and how to use them here.
|
|
Rev. 2 (21 Feb. -09)
|