Saturday, September 12, 2015

Heuristics in Perkun 0.0.9

In (yet unreleased) Perkun (http://sourceforge.net/projects/perkun/) 0.0.9 there will be a new mechanism to control the loop in the function get_optimal_action.

The optimizer will be inherited from a class called "class_with_tracking" which (as an attribute) will contain a stack of trackers. Each tracker will have access to the currently best action, current action, current best result. Based on the stack of trackers the program will decide how to proceed in the loop. There are three possible decisions:
  • NONE
  • BREAK
  • CONTINUE
NONE means we are proceeding with the current action. BREAK means we are terminating the execution (we are happy with the current best action) and CONTINUE means we skip the current action, but proceed with the loop.

The user embedding Perkun in his own programs will be free to override the virtual function:

class_with_tracking::decision class_with_tracking::make_decision(const std::list<tracker*> & s)

The decision returned by it will be precisely NONE,BREAK or CONTINUE. In the default implementation it is NONE, meaning exhaustive search of the game tree.

No comments:

Post a Comment