Language: C++

Setup a new agent

Create a file myprogram.cpp. The Agent code should include the following:

#include "agent/agentclass.h"

int main(int argc, char *argv[]) {
    Agent *agent;
    string nodename = "node_name_here";
    string agentname = "agent_name_here";

    agent = new Agent(nodename, agentname);
    string agent_name_here_soh = "{\"data_name_here\"}";
    agent->set_sohstring(agent_name_here_soh.c_str());

    while(agent->running())
    {
       /********************
        do something smart in here
       ********************/
    }
}

 


Tags: