In this chapter we show you how to run mindless.jactr
model on PoJACT-R bot.
Let's start by opening the 01-MindlessBot example project bundled in the Pogamut plugin for Netbeans.
Follow these steps:
Open Netbeans (
→ → → )Once Netbeans were loaded open example project:
→ → → → then clickIn New Project dialog enter name of the
folder where the example will be unpacked, for example
01-MindlessBot
, after you are finished click
button.
Now a project named "01-MindlessBot" will be opened in the Projects tab, open project's Source Packages sub folder and then the cz.cuni.amis.pogamut.ut2004.examples.pojactr package contained in this folder
Finally double click
MindlessPoJACTRBot.java
file containing source code of
our first bot
Notice that the project's node in Projects tab is in bold, this means that the (F6) and (Ctrl + F5) buttons are linked to this project. Before we will start this first bot we have to launch the Unreal Tournament dedicated server - an environment simulator that the bot will connect to. We suppose you read 00-EmptyBot tutorial, so you know how to run and inspect Pogamut bot.
Now return back to the Netbeans (if UT was in full screen mode use Alt + Tab). We will go through bot's source code in order to describe its basic idioms.
The MindlessPoJACTRBot extends
PoJACTRUT2004Bot
class, this is declared by line
in MindlessPoJACT-RBot.java
:
public class EmptyBot extends PoJACTRUT2004Bot
PoJACTRUT2004Bot
is a base PoJACT-R bot
class that will suit most situations.
PoJACTRUT2004Bot
implements by default all
methods, so in you don't need to implement nothing. Main configuration
of bot is done in MindlessPoJACTRBotModule.java
. This class
extends PoJACTRUT2004BotModule which configures most of Guice bindings.
However there are several binding that Mindless bot has to configure by
himself.
These bindings are:
bind(IWorldView.class).to(UT2004SyncLockableWorldView.class)
- Binding of world view. It is recommended to bind it to
synchronized world view.
bind(IAgent.class).to(MindlessPoJACTRBot.class)
- binding of agent class for Pogamut
bind(IPoJACTRAgent.class).to(MindlessPoJACTRBot.class)
- binding of agent class for jACT-R (has to be same as for
Pogamut)
bind(String.class).annotatedWith(Names.named("Log4jConfig"))
- binding of log4j config. See chapter about logging.
bind(URL.class).annotatedWith(Names.named("ModelURL"))
- binding of URL of the model.
The last binding bring us to most important file of PoJACT-R bot:
source of ACT-R model. Source of model for jACT-R can be in both old
LISP syntax or new XML syntax, but use of XML syntax is recommended. Use
LISP syntax on your own risk. Model of mindless bot is in
mindless.jactr
.