Using the Ada client
Prev
Next

Chapter 2. Using the Ada client

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 agents ) and copy one of the sample agents to a new agent: cp rotate.ads my_agent.ads && cp rotate.adb my_agent.adb Then go up a directory ( cd .. ) and change the links: rm -f agent.ads agent.adb ln -s agents/my_agent.ads agent.ads && ln -s agents/my_agent.adb agent.adb Now your agent should be compiled when running make. Now you can start programming your agent by filling the procedure bodies in my_agent.ads.

Procedures that you should fill

Get_Action

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.

The inform procedures

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.

Prev
Next
Home


Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team