## 6 Case Study
### Operation Resources Self-Organizing Interaction  
Figure 11: Operational Resources Interaction to Execute the Case Study. Figure 11 shows the interaction between the available operational resources to manufacture the case study batch order. In the very beginning a start event is sent from the batch order agent to the orchestrator agent in a form of a REQUEST-WHEN message as it can be seen in line 1 of Figure 11. After receiving the start event, the orchestrator agent makes sure that a batch order and the minimum required operational resources exist, therefore the orchestrator agent randomly selects a free pair of one worker and one IR. Then the orchestrator agent is pairing the worker and the IR by sending two INFORM-REF messages for each. In Figure 11 line 2, 3 we can see that the orchestrator agent pairs Worker-1 agent to coordinate with Robot-2 agent. The INFORM-REF message sent to Worker-1 contains the AID address of Robot-2 and vice versa. Then in line 4, 5 of Figure 11 the orchestrator agent sends another two REQUEST messages to Worker-1 and Robot-2 to inform them with the assigned task which in this case is CP:1 order. When CP:1 order is assigned to a robot agent, it will extract the number of pumps in the order and multiplies it by two minutes to calculate the overall time of being in busy-state. While the worker remains in a reserved-state for two minutes starting from the task assignment event. Then the worker goes to a busy-state till it finishes with assembling the CP:1 order. When the orchestrator agent realizes that the batch order still not finished and available operational resources exist. It pairs between the other free operational resources which in this case are Worker-2 and Robot-1. This pairing can be seen in the INFORM-REF messages which are shown in Figure 11 line 6, 7. An INFORM message is sent from Robot-2 to the orchestrator agent as it can be seen in line 8 of Figure 11, this message expresses that CP:1 order has been already accomplished. The reason that Robot-2 sends this INFORM message is to tell the orchestrator agent to change its status from busy to free. Therefore the orchestrator agent takes Robot-2 into consideration in the next task assignment cycle. The orchestrator agent assigns the CP:2 order to Worker-2 and Robot-1 in line 9,10 of Figure 11 by sending two REQUEST messages to them. Subsequently, Robot-1 tells the orchestrator agent that it has done with loading all the pumps in CP:2 order for Worker-2 as can be seen in line 11 of Figure 11.  
An AGREE message sent from Robot-2 to the orchestrator agent can be seen in line 12 in Figure 11, this message tells the orchestrator that Robot-2 has been unregistered from the workcell. The orchestrator understands that this specific AGREE message means a robot deregistration event from the message conversation-id \"RobotDeregistration\". Line 13, 14 in Figure 11 show two INFORM messages sent from Worker-1 and Worker-2 respectively to the orchestrator to tell that they have done with assembling CP:1 and CP:2 orders respectively. Then the orchestrator pairs between Robot-1 and Worker-1 as can be seen in line 15, 16 of Figure 11. Then in line 17, 18 of Figure 11 the orchestrator assigns a new order CP:3 for this pair. Worker 2 informs the orchestrator in line 19 of Figure 11 that he is unregistered from the workcell. The orchestrator understands that this specific message means a worker deregistration event from the message conversation-id \"WorkerDeregistration\". In line 20 of Figure 11, Robot-1 tells the orchestrator that it has done with loading all pumps in the CP:3 order to Worker-1. Line 21 in Figure 11 shows a new pump order CP:5 sent from the pump agent to the batch agent via an INFORM message, while line 22, 23 shows sending the pump order from the batch agent to the orchestrator agent. Line 24 in Figure 11 shows an AGREE message sent from Robot-2 to the orchestrator to tell it is registered again to the workcell.