Tuesday, April 27, 2021

Precalculations in svarog-0.0.4

 There will be a new command in svarog-0.0.4 (that has not been published yet). The command syntax is:

cout << precalculate(<depth>,<granularity>) << eol;

Example:

cout << precalculate(4,2) << eol;

This command generates (and prints to the standard output) a Svarog specification with a precalculated knowledge about the optimal actions for the given depth of planning and granularity.

The depth is the same parameter as the one passed to the loop command - it is the depth (or height) of the game tree. It should be a small integer.

The granularity should be a small integer value, preferably 2. Svarog will discretize the space of beliefs, which is a hypercube of n dimensions, with n being the amount of possible states for a given visible state. Then when planning it will be able to use the precalculated knowledge so that it searches for the closest node in the hypercube to the actual belief.

 

WARNING: For a reasonable specification running this command can take a couple days.

It should significantly improve the performance when planning. 

In some cases the amount of possible states is still too large to build this discrete hypercube, even for a small granularity (2). For example when the amount of possible states equals 32 then the amount of nodes in the discrete hypercube is 4.29497e+09. In this case (whenever the amount is greater than 1024) Svarog will denote the visible state as "too complex". When encountered these visible states the planning should be done normally, although for the "future beliefs" we still may benefit of the precalculated cache knowledge.

The idea is that the computer analyses the given Svarog specification and performs planning for hypothetical visible states and some beliefs. Then it will have a list of "rules" of the form:

<visible state> x <belief> -> <optimal action>

It will clearly not cover all possible beliefs, but we will be able to find the closest rule to the actual belief in terms of the cartesian distance.


Thursday, April 15, 2021

dorban-0.0.0 - demo for Svarog

I have written a small demo program for Svarog. It is called dorban, it can be downloaded from https://sourceforge.net/projects/dorban/ .

I will describe it on my website https://www.perkun.org .



Tuesday, October 20, 2020

Svarog test5

I have added to the github repository for Svarog a new test, test5. It is activated by running "make test5" in the examples folder. It is based on the Svarog specification examples/example3_dorban.svarog .

When you run the test5 it is good to have an assistance of multiple svarog daemons. The client should have a configuration file /home/$USER/.svarog/svarog.ini in place.

The specification contains three hidden variables and five localizations. The localizations are connected as follows:

The input variables are:

  • has_dorban_won_a_fight (normally none, after attacking a vampire true or false)
  • where_is_dorban - one of the places
  • can_dorban_see_pregor - true or false
  • can_dorban_see_pregor_is_alive - normally none, if dorban can see pregor either true or false
  • can_dorban_see_vampire - true or false
  • is_pregor_following_dorban - true or false

In test5 Dorban immediately meets Pregor in Krakow (alive), asks him to join him, then they go together to Warszawa, do not find vampire here, then they go to Poznan and meet the vampire. The first attack is succesfull, but the second one fails and Pregor (still alive) is not accompanying Dorban any more. Then Dorban asks Pregor to accompany him, Pregor accepts, they both attack the vampire and the attack fails. Pregor dies. When Dorban sees that Pregor is dead he knows he would not ever become living any more, and Dorban decides to attack the vampire on his own.

The svarog with all the examples can be downloaded from https://github.com/pawelbiernacki/svarog.

Sunday, October 4, 2020

svarog-0.0.3 has been released!

 svarog-0.0.3 has been released! It contains apart from the interpreter (svarog) also a daemon (svarog-daemon) and a helper program: svarog-dummy-client. Now when working in an interactive mode (command loop) svarog will try to use the svarog-daemons (if configured so). Svarog is a bit slower than Perkun because it does not create a memory cache for the model, but it is much more powerful due to the support of the svarog-daemons.

Download svarog-0.0.3 from https://www.perkun.org/Download

Monday, September 28, 2020

svarog 0.0.2 has been released

 A new version of svarog (0.0.2) has been released. It has some minor improvements. Currently the negative numeric literals are allowed (unary minus is supported). This can be useful when defining payoff.


Svarog 0.0.2 is available for download from my page https://www.perkun.org

Tuesday, May 12, 2020

Perkun2 is wrong!

I have an impression that Perkun2 is wrong! The problem is the belief of the agents that are not the first (main) agent. I am not sure how to fix this.