Tuesday 14 July 2009

PrologBeans Intro

I use PrologBeans to interface Jade (built on Java) and Prolog. Google it for details. Roughly, what you need to do is:
  1. Start up an agent (a Java file). E.g. 'AgentNegotiatior.java' as contained in my 'argmas09modified' directory.
  2. From this, make a connection to a Prolog server using 'PBConnect.java' (leave this unchanged) which requires a Prolog file like 'run.pl'. The Prolog file (in my case 'run.pl') loads up 'pbconnection.pl' (which I have modified for my purposes) and whatever other Prolog files you need to load (containing your Prolog clauses) before calling 'main' (defined in 'pbconnection.pl').
  3. Run your queries from the Java file using a 'PrologSession' instance.
  4. Shut down the server upon completion from your Java file.

Hope that makes sense.