# Human-Centered Dynamic Service Scheduling Approach in Multi-Agent Environments
## 3 Human-Centered Dynamic Service Scheduling Approach
### Multi-Agent Scheduler  
#### 3.2.1 Job Decomposer  
The service is independent and has no correlation with other services. However, the service job requested by a user may have specific requirements regarding when it should be provided. We categorized these additional user requirements as follows:  
* Perform the service first;
* Perform the service last;
* Perform the service in a specific order;
* Perform multiple services simultaneouly;
* Perform the service only when specific conditions are met.  
These additional requirements contribute to sequential interdependencies among different services. As we have defined a service as a single job, a job may contain a certain sequence of activities and prerequisites, detailing how it should be delivered. The activities are transcribed into operations, and prerequisites are stored for a specific time and situational condition that can be followed by multiple agents. For agents to successfully provide services, a job must be translated into an executable one, considering the agents' capabilities and action units. We divide a job into operations, which are a collection of essential actions completed independently by a single agent. This allows multiple agents to perform a job by completing sequential operations. For example, when a person asks for coffee, the job \"Bring coffee\" can be divided into two operations: \"Get coffee from the coffee machine\" and \"Bring coffee to the table\". Each operation has its own order because bringing coffee should only be executed after getting coffee is complete.  
The job decomposer decomposes the requested jobs into operations and creates an operation list for user requests. When the user requests M jobs for the agents to perform, each job J1, J2,..., JM is decomposed into a sequence of one or more operations. For example, job J1 is decomposed into (O11, O12,..., O1n). We assumed that there is a job-to-operation database for properly mapping jobs to operations. The operation list (Table 1) consists of variables such as the operation type, object, capable agents, and the agent's operation completion time, etc. Operation types can be \"fetch\", \"drop\", or \"move\" etc. The object is the target of the operation. The start and end positions are where the operation starts and ends, respectively, and information is obtained from the target object. A capable agent lists the agents that can perform the operation. The duration of each agent is a predetermined nominal number and represents the execution time of the operation. If the agent is unable to perform the operation, the duration time is set as infinite. As previously described, the job decomposer is presented as pseudocode in Algorithm 1.  
Figure 1: Diagram of the proposed scheduler framework.  
```
//Given Variables \(J_{M}\) = {\(j_{i}\), \(j_{x}\),..., \(j_{i}\),..., \(j_{M}\)} //Set of Requested Jobs \(A\) = {\(a\), \(a\), \(a\)} //Set of Agents //Initialization \(O\) //Set of Operations of Job \(j\) \(R\) //User Requirement values of Job \(j\) \(c_{i|,k}\) //Capability of Agent \(a\) performing Operation \(o_{ij}\) \(d_{i|,k}\) //Duration time of Agent \(a\) performing Operation \(o_{ij}\) \(C_{i}\) = {\(C_{i}\), \(C_{i2}\),..., \(C_{i\bar{o}}\),..., \(C_{N}\)} where \(C_{i\bar{o}}\) = {\(c_{i|,a}\), \(c_{i|,a}\), \(c_{i|,a}\)} \(D_{i}\) = {\(D_{i}\), \(D_{i2}\),..., \(D_{i\bar{o}}\),..., \(D_{N}\)} where \(D_{i\bar{o}}\) = {\(d_{i|,a}\), \(d_{i|,a}\), \(d_{i|,a}\)} ifNew Jobs (\(J_{M}\)) are Requestedthen fori = 1 to \(M\)do \(O_{i}\) \(\leftarrow\) JobDecomposer(\(j\)) \(R_{i}\) \(\leftarrow\) getUserRequirements(\(O\)) \((C_{i}\), \(D_{i})\) \(\leftarrow\) getNominalValues(\(O_{i}\), \(A\)) \((O\), \(R\), \(C\), \(D)\) \(\leftarrow\) pushback(\(O_{i}\), \(R_{i}\), \(C_{i}\), \(D_{i}\)) \(i\) \(i\) \(i\) \(i\) \(i\) \(i\)
```  
**Algorithm 1**JobDecomposer(\(0\))  
Managing user requests of service with additional requirements and complicated user requirements are addressed in the next section.