5. Using your own agent - coppolam/swarmulator GitHub Wiki

All agents must be a child of the class Agent, to be found at sw/simulation/agent.cpp.

You can define an agent as a child class of Agent, and, as for controllers, define that you want to use it in sw/settings.h. You can look at the controllers in sw/simulation/agents/... for examples of agents, where you can declare the dynamics of the agents.

Alt text

To set up your new agent, do the following

  1. Run the script to make the skeleton for a new agents.

    cd scripts

    ./make_new_agent.sh <name_of_agent>

    This will create the skeleton of your new agent, which can be found in sw/simulation/agents

  2. Add your controller to sw/simulation/includes_agents.h

  3. To use the agent, define it in settings.h