Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

(C++) NarmedBanditLearner

 

 

Artificial Intelligence code snippet how to implement a Learner class that has to optimize its reward from an N-armed bandit. As one would expect, the Learner class knows nothing about the N-Armed Bandit class' internals.

 

Give a Learner a set of actions, with every action having a certain expected reward. Actions taken are evaluated by adjusting the expected rewards. The chance an action is equal to its expected reward of the sum of expected rewards.

 

The Learner class has an internal Strategy Design Pattern, which enables the user to select a different Learning Strategy at run-time. In the example main, this Strategy is set randomly.

 

* Download the 'NarmedBanditLearner' source code (zip)

* Download the 'NarmedBanditLearner' source code (rar)

* Download the 'NarmedBanditLearner' Windows executable (zip)

* Download the 'NarmedBanditLearner' Windows executable (rar)

 

Licence

 

 

NarmedBanditLearner, an N-armed bandit and learner class demonstration

Copyright (C) 2006 Richel Bilderbeek

 

This program is free software: you can redistribute it and/or modify

it under the terms of the GNU General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.

 

This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU General Public License for more details.

You should have received a copy of the GNU General Public License

along with this program. If not, see <http://www.gnu.org/licenses/>.

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.