Tuesday, October 17, 2017

Set commands with conditions

An update to my idea. I have a syntax for the "set" command from BOBR:

set({where_am_I=>(X:place)},{optimal_action=>(A:action)},{where_am_I=>(Y:place)},1.0):-there_is_a_connection(X,Y),has_target(A,Y);

The condition (optional) follows ":-" like in Prolog. All the logical placeholders are declared with the class (in the example above X has class "place"). The condition in the example above is:

there_is_a_connection(X,Y),has_target(A,Y)

I imagine I will write an engine in Java that resolves the condition. This engine will be included in the Java code created by BOBR.

Saturday, October 14, 2017

Assertions about objects

I just got an idea. If you still recall the BOBR project - I thought of adding the assertions (Prolog-like facts and rules) to the specification.

class boolean;
object false:boolean, true:boolean;
assert equal(false, not(true));
assert equal(true, not(false));


In fact you could also tell BOBR about the possible connections between the cities in PerkunWars:

class place;
object place_Wyzima:place, place_Shadizar:place, place_Novigrad:place;

assert there_is_a_connection(place_Wyzima, place_Shadizar);
assert there_is_a_connection(place_Shadizar, place_Novigrad);

assert there_is_a_path(X,Y):-there_is_a_connection(X,Y);
assert there_is_a_path(X,Y):-there_is_a_connection(X,Z), there_is_a_path(Z,Y);


This would allow you deducing that there is a path from place_Wyzima to place_Novigrad.
It is just an idea. Of course my dream would be to use the knowledge somehow to produce the model. I will think about it.

Wednesday, October 11, 2017

Perkun presentation

I have recorded and uploaded to YT a film - the Perkun presentation.
This is the same presentation I was giving for the AI Helsinki.

Tuesday, October 10, 2017

YT film about Perkun

This is a short film demonstrating Perkun specifications and the sessions for two examples from the PerkunWars.

Monday, October 9, 2017

AIHelsinki has published my Perkun slides

You can download my Perkun slides from
http://www.aihelsinki.com/past-event/aihelsinki-14th-session-september-27/

I am very grateful to AIHelsinki, thank you!

The mathematics for the algorithm is not shown on the slides, but they are good in showing what this is all about. The examples are taken from the PerkunWars game (https://sourceforge.net/projects/perkunwars/). Maybe I will write again about the game a little:

You can be in one of three places: Wyzima, Novigrad, Shadizar. There are some NPCs (non-player characters). There is also a vampire. You can attack him but it is a good idea only when there are some NPCs around, because they are going to help you. One NPC is Dorban - a witcher who is constantly looking for the vampire. Two other NPCs (Pregor and Thragos) are avoiding the vampire.

All the NPCs are controlled by the Perkun interpreter. You can "chat" with them to see what their opinion is. If you take a look at the Pregor and Dorban specifications you will see that their payoff functions is different - Pregor "obtains" 100 points for not seeing the vampire and 0 points when he is seeing him. Dorban - on the contrary - "likes" to see the vampire (you can tell from his payoff function).

If you take a look at the source code of the PerkunWars you will see the class "npc" instantiated. This class is inheriting from the Perkun optimizer (perkun::optimizer_with_all_data). There is a separate process running for each NPC. These processes "talk" with the main process through pipes.