Friday, March 4, 2016

Perkun2 0.0.1 - with embedded Perl!

I have published Perkun2 version 0.0.1 (https://sourceforge.net/projects/perkun2/). It contains Perl! After the "interfaces" section you may type:

values{}
agents{}
interfaces{}
<<PERL
print "this is Perl code\n";
PERL

There is also a predefined object $Perkun2::Optimizer::optimizer that supports multiple callbacks called by Perkun2. For example this is how you can register a callback "print_prompt":

<<PERL
$$Perkun2::Optimizer::optimizer{print_prompt} = sub { print "Hello: "; };
PERL


Other callbacks are:
  • execute
  • on_action
  • print_current_belief
  • print_initial_loop_message
See the examples in the folder examples/examples_perl.

The Prolog generators created by the version 0.0.1 are modified so that they do not insert the model set instructions that would contain probability 0.0. This makes the generated specifications significantly smaller.



Sunday, February 28, 2016

Perkun2 0.0.0

I have written and published Perkun2 (https://sourceforge.net/projects/perkun2/). It is similar to Perkun but supports multiple intelligent agents performing the actions interchangeably. Take a look at the website (http://www.pawelbiernacki.net/software/perkun2/index_pl.jsp), download Perkun2, see the examples.

Sunday, September 27, 2015

Perkun 0.0.9 released!

Perkun (http://sourceforge.net/projects/perkun/) 0.0.9 has been released! It contains multiple classes mentioned previously that facilitate applying heuristics. It contains also a new class - dump_controller, inherited by the optimizer_with_all_data, which controls dumping the data in the verbose mode. It is possible to redirect various data to the XML or text files, to stdout, stderr or a single file. Take a look at the constructor dump_controller::dump_controller in the file dump_controller.cc.

Monday, September 21, 2015

JPerkun

There is a Perkun (http://sourceforge.net/projects/perkun/) port in Java. You can download it from http://www.pawelbiernacki.net/software/perkun/jperkun.jsp. There are two JARs there:
  • JPerkun.jar - the Perkun port to Java (a library)
  • Perkun.jar - a Java application based on JPerkun
They both contain the source code. In order to run an example execute:

java -jar Perkun.jar example.perkun

Multiple features are not yet implemented though. The primary functionality should be there.

Sunday, September 13, 2015

Action iteration controller - Perkun 0.0.9.

You may have noticed that the feature described recently in Perkun (http://sourceforge.net/projects/perkun/) 0.0.9 allows breaking the computation in any moment. This ability is not so great, though, if we process the actions in a strict, a-priori defined order. A new class has been introduced to relax this order. It is called action_iteration_controller. It is derived from class_with_tracking, and so can benefit of its stack of trackers. It contains three virtual functions:

virtual std::list<action*>::const_iterator get_action_iteration_begin() const;

virtual void action_iteration_increment(std::list<action*>::const_iterator & target) const;

virtual bool get_action_iteration_terminated(const std::list<action*>::const_iterator & i) const;

It is inherited by the class optimizer. Whenever the get_optimal_action iterates over the actions it uses these three functions. In your own programs you are free to override them providing a new (possibly random) order of the action iteration. And you can base these new orders (permutations of actions) on the knowledge stored in the stack of trackers!



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.

Friday, September 11, 2015

Perkun API. The variables.

In Perkun (http://sourceforge.net/projects/perkun/) there are three classes representing variables:


It is:
  • perkun::hidden_variable
  • perkun::input_variable
  • perkun::output_variable
They are all inherited from the class perkun::variable. Each variable has a list of allowed values. You might need to use these classes when you embed Perkun in your own programs.