Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

Space Matrix Division

Diogo Cruz edited this page Nov 17, 2018 · 1 revision

Each Captain initiates with the General the negotiation protocol fipa-propose, with a view to establishing the region of the space that will be his responsibility. This protocol defines how to propose something to other agents and deal with their responses. The fipa-propose protocol is supported by the interfaces that a Captain implements through behaviors and by the ExchangeInformation method. The message has the performative PROPOSE and in its contents a string with the coordinates of the desired point. The General keeps the information regarding the distribution of the Captains for the space and, as he receives requests from the Captains for his initial position, consults the information on the occupation of the space and, in case the requested region is free, respond by authorizing the position in the requested region. If the region is already occupied, the General responds negatively. The Captain who requested the occupied region, will have to request another region to position itself.

In order to ensure that there are no failures in communication between the Soldiers and their Captain, the regions affected by each Captain are twice as wide as the radius of communication, and the Captain is placed in the center of that region.

Once the Captains are correctly positioned, and with their defined regions, each Soldier wakes up with the rest of the space region that he will be responsible to explore.

Since space is a rectangular matrix, in a first implementation phase, we assume that the number of Soldiers is equal to the number of lines in the matrix, so that each Soldier has a line.

Each Soldier chooses a line and then communicates to the rest his choice, who are in charge of confirming the affectation. An example of this communication sequence is represented below:

  1. Soldier 1 communicates to the others the space that he wants to explore;
  2. Soldier 1 receives confirmation from the rest and becomes attached to the space he intended;
  3. Soldier 3 communicates to the others the space that he intends to explore;
  4. Soldier 2 communicates to the others the space that he intends to explore;
  5. Soldier 3 receives confirmation from the rest and becomes attached to the space he intended;
  6. Soldier 2 receives confirmation from the rest and is affectionate to the space he intended.

In this example, it is assumed that there is no overlap in the choices. When there is overlap, some of the Soldiers will have to give up their choices and communicate new, awaiting confirmation.

Clone this wiki locally