The agents are preconfigured and will contain the specification of each agent that can connect with the simulation. During the first connection, the agent is designated with one of the configurations registered previously by the major configuration file sent to the server on the start of the simulation.
Communication data
The only information that the agent need to send to the simulatio it's its token. With the agent token, the simulation can locate all its data and all the changes that are needed will be attributed and sent back to the agent in the end of the step. Using the JSON pattern of communication, the exemple of what is expected the agebt to send the server can be seen below:
{
"token": "eyauhsuahashuas120912ajsja.umclmasjuemduh01920.auhsukmdclmahas19219"
}
- token : An unique identifier given to an agent
Agent structure
Each agent has some static fields containing information about itself and some fields that can be constantly changed depending on the action of the agent on the previously step.
The agent class it's only stored inside the server, the agent just need to know its token to
communicate
{
"agentClass": {
"name": "agentA1",
"class": "Drone",
"specs": {
"coord" : {
"coordX" : -30.0277,
"coordY" : -51.2287
},
"speed" : 5,
"recharge" : 10,
"discharge": 2,
"basePhysicalLoad" : 15,
"maxPhysicalLoad" : 25,
"physicalContent" : ["Person", "Apple", "Water"],
"baseDigitalLoad" : 50,
"maxDigitalLoad" : 1000,
"digitalContent" : ["victimPicture", "waterPicture"],
"baseBattery" : 10,
"maxBattery" : 25,
"skils" : ["takePicture", "collectWater"],
"roads" : ["water", "land"],
"route" : [{}]
}
}
}
-
class : Type of agent (drone, motorcycle, car, etc)
-
specs : The attributes of that agent * coord : The actual location of the agent * speed : How many 'units' the agent can move in one step * recharge/discharge : How fast the agent recharge/discharge it's battery * base/maxPysicalLoad : How much physical volume the agent may carry * base/maxDigitalLoad : How much digital volume the agent may carry * physical/digitalContent : What the agent is carrying * base/maxBattery : The agent's battery size * skills : Which actions it's capable to do * roads : Which roads the agent can navigate * route : The agent route to get to a place (initially empty)
Personal percepctions
After every step the agent is notified about the changes in the map and its own changes. To avoid repeating all the fields that the agentClass
has, the informations are limited to the possible changes with it's fields completed or empty, this means that the agent must accept empty fields in the response from the server.
The special field route
will be changed only if the agent send the request to do a move
action to keep a track about the route and notice if it changes during the steps.
All the fields were already explained above
{
"coord" : {
"coordX" : -30.0277,
"coordY" : -51.2287
},
"basePhysicalLoad" : 15,
"physicalContent" : ["Person", "Apple", "Water"],
"baseDigitalLoad" : 50,
"digitalContent" : ["victimPicture", "waterPicture"],
"baseBattery" : 10,
"route" : [{}]
}
Roles
The configuration file (can be find in the ServerConfiguration
file) has all the possible roles to a simulation. The roles attribute is a group of agentClass
es that was explained above. Each agent will recieve an agentClass ramdonly and it will determine the kind of agent it can be and all the specifications it has to respect.
{
"roles": {
"agentClass": {}
}
}