|
Page 4 of 4 This tutorial will assume that you want to create an agent named <myNewAgent>. In reality, you probably want a different name, so just substitute your name wherever you see <myNewAgent>. Create the files Create a new agent by copying the existing random CPP agent:
$>cd agents
#First thing we'll do is clean out the random agent so we don't get extra object files we don't need $>cd randomAgentCPP $>make clean $>cd ..
#Now, make a copy of this agent $>cp -R randomAgentCPP <myNewAgent> Change the appropriate file names$>cd <myNewAgent> $>cd src
#First, rename the source files $>cd <myNewAgent> $>mv RandomAgent.cpp <myNewAgent>.cpp $>mv RandomAgent.h <myNewAgent>.h
Edit the source file$>emacs RandomAgent.cpp #Use your favorite editor
Near the top, you will see the line: #include "RandomAgent.h"
Change this to: #include "<myNewAgent>.h"
Save the file.
Edit the MakefileGo back up to the main directory for your new agent: $>cd ../../
Edit the Makefile with your favorite editor: $>emacs Makefile
The only line you need to change is: AGENT = RandomAgent.cpp
Change this to: AGENT = <myNewAgent>.cpp
Save the file.
Note: If you wanted to move your agent folder to a new location, even outside of the rl-competition distribution, all you need to do is update one line of the Makefile. Find the first line: RL_GLUE_BASE = ../../system/RL-Glue
Change this to: RL_GLUE_BASE = /path/to/rl-competition/system/RL-Glue #this can be a relative or absolute path Try it outIn one terminal window, go run the graphical Java trainer: $>cd trainers/guiTrainerJava $>bash run.bash
In another terminal window, build and run your new agent: $>cd agents/<myNewAgent> $>make $>bash run.bash
With any luck at all, you should be able to load and start an experiment and your agent will be running! Congratulations!
|