Skip to content

Writing your own Rover Agent

Swen E Gaudl edited this page Aug 19, 2015 · 3 revisions

Writing your own agent based on the rover code:


If you are using an IDE in previous versions of agentscape you needed to modify the pom file rover/pom.xml and change

  • the version number, which you can still doto have different versions of your agents
  • the artififactID, which is the jar archive name
  • change the two to three things ;)
  • the mainclass to point to your agent class file, e.g. TemplateRover by default

With the new version of agentscape and the Agentscape configuration editor Agentscape editor you can now set the most important parameters yourself. Meaning, the number of agents-_Copies-you want to run AND the agent class file from the rover-agent.jar-Class-. This allows now that you can have one jar containing all your agents.

Programming your agent

  • Start by looking at the rover module rover (just rover not rover.monitor or the like)
  • The TemplateRover class contains a a basic implementation and extends the Rover class
  • all information into your rover come in through the poll results which can be used as a state machine.
  • all commands which can be used are given in Rover so you can move,deposit,scan,collect and send messages
  • Duplicate the TemplateRover class and change the team name to a meaning representation,e.g. your bucs-id only required for students which take the Bath Agents course
  • Change the name of the duplicated class as well to something else, preferable the task or special ability your new rover has
  • Write a great agent!!! mandatory :)
  • At the end use maven to mvn install to compile the rover module

This will automatically install the jar files into the appropriate places in your agentscape directory.
Agents will go in agents/, the service will go in services/ etc.
You probably need to compile shared first, then service, and then the monitor and rover agents.

Enjoy!