Skip to content

Latest commit

 

History

History
41 lines (34 loc) · 1.31 KB

javaagents.md

File metadata and controls

41 lines (34 loc) · 1.31 KB

MASSim Javaagents Documentation

This module provides some very basic agent framework written in Java. EISMASSim is integrated so that agents can communicate with the MASSim server out of the box.

Some very basic agents are included mainly for testing purposes.

Create your own agent

  • Add a new class for your agent somewhere in massim.javaagents.agents
  • Make your class extend massim.javaagents.agents.Agent
  • Add your class with a type name to the setEnvironment() method of massim.javaagents.Scheduler
  • Create a JSON configuration file for your agents

Java agents configuration file

A sample configuration might look like this

{
  "agents" : [
    {
      "count": 20,
      "start-index": 0,
      "agent-prefix": "A",
      "entity-prefix": "connectionA",
      "team": "A",
      "class": "BasicAgent"
    },
    ...
  ]
}

The attributes are

  • count: how many agents to create
  • start-index: the index that is first appended to the prefixes
  • agent-prefix: the prefix for all agents' names
  • entity-prefix: the prefix of all entity connections
  • team: the agents' team name
  • class: the agents' type as registered in the scheduler class

Of course you can specify multiple blocks to configure multiple teams or sets of agents with different agent classes in the same file.