IndiGolog OAA agent may be viewed as an agent that executes its
IndiGolog control routine and additionally has access to other OAA
agents in the system and is capable of reacting to the incoming
OAA messages.
This is the general pattern of changing the state of the agent in
response to incoming OAA events. The reactions to these events can
usually be programmed using interrupts. The main IndiGolog program
may then look like this:
proc(control,
[
<probably, some initialization>
prioritized_interrupts
([
interrupt(<check
the value of the fluent that changes
when
some very important OAA event arrives>,
<do
something to respond>),
interrupt(<check
the value of the fluent that changes
when
some less important OAA event arrives>,
<do
something to respond>),
interrupt(true,
<do something - normal execution>)
])
]).
The first two interrupts are then the reactive part of the program,
while the third one is the proactive part.
If we follow the above process, then writing an IndiGolog agent
that is both proactive and reactive involves:
- Declaring the needed procedure solvables using
initial_solvables(<solvables list>)
- Declaring the corresponding exogenous actions. The declared
exogenous actions should be the exact copies of the procedure
solvables. For example, if we declare the solvable:
solvable(update_status(New_Status), [], [])
then we will need to have the following exogenous action:
exog_action(update_status(New_Status)).
- Declaring the fluents, whose values are going to change when
certain OAA events arrive. For example:
prim_fluent(status).
- Writing the successor-state axioms that relate the incoming
events and the corresponding fluents. For example:
causes_val(update_status(New_Status),status,New_Status,true).
- Writing the main procedure using interrupts as described above.
Name the procedure 'control'.
- Specifying the name of the agent using
agent_name(<name>)
Multifile
Declaration
In order to build an executable agent program, one needs to compile
the Prolog source file and then link it with IndiGolog interpreter,
IndiGolog-OAA interface and OAA libraries.
For this process to succeed, the agent source file has to start
with the following multifile declaration:
:- multifile prim_action/1, prim_fluent/1, causes_val/4, poss/2,
proc/2, exog_action/1.
It should be the first (uncommented) line of the file. Declaring
a predicate multifile means that its clauses can be spread across
several different files. This is exactly the case here.
Files
Needed for Compilation

Note: The following applies to Quintus Prolog for Unix. These scripts are unlikely to run under MS Windows.
These are the files needed to successfully compile an IndiGolog
OAA agent:
- <name of your program>.pl The source code for
the agent.
- interface.pl The IndiGolog-OAA
interface file (rename to ".pl").
- interpreter_m.pl
The IndiGolog interpreter (rename to ".pl").
- oaa.pl The OAA Prolog library.
- com_tcp.pl The OAA communication library.
Each of the files needs to be compiled using the following command
line:
qpc -c <name of the file>.pl
This will generate the file in the Quintus Object Format with the
same name and with extension 'qof'.
The object files are then linked together:
qld -d -S -lsocket -lnsl -o <desired name for the application>
<name of your program>.qof interface.qof interpreter_m.qof
oaa.qof com_tcp.qof
This will generate an executable with the desired name.
Creating
Java agents
For help on creating OAA agents in Java see the OAA documentation.
You can also take a look at one of
the examples provided here.
|