Copy or link the files in the directory
asimulator/clients/ada
to the directory that you want to
work in. Change to the subdirectory
agents
(
cd
)
and copy one of the sample agents to a new
agent:
agents
cp
Then go up a directory
(rotate
.ads
&&
cp
my_agent
.adsrotate
.adbmy_agent
.adb
cd
)
and change the links:
..
rm
Now your agent should be compiled when running
-f
agent.ads
agent.adb
ln -s
agents/
my_agent
.adsagent.ads
&&
ln -s
agents/
my_agent
.adbagent.adb
make
. Now you can start
programming your agent by filling the procedure bodies in
.
my_agent
.ads
This is the interesting procedure where the agent decides which action it should perform based on the current percept, the rules and whatever information the agent has stored.
Inform_About_The_Rules is called once in a simulation to show the rules to the agent before it really begins. The agent should use this opportunity to check the rules to make sure they are what the agent was designed for. If it finds a rule that it was not designed to handle it should send a notification and raise UNACCEPTABLE_RULES.
Fill the bodies of the procedures Inform_About_A_Clear_Tile, Inform_About_A_Clear_Tile_With_Enemy, Inform_About_A_Wall_Tile and Inform_About_A_Danger_Tile if you want your agent to take advantage of that information.
Fill the body of the procedure Inform_About_Score if your agent is interested in how it performed in the simulation.
Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team