# Synchronous Remote Calibration for Electricity Meters: Application and Optimization
## 3 Methods
### Algorithm
#### 3.2.3 Strategy Comparison  
In order to achieve our optimisation goal, we require a method for evaluating scheduling strategies. This section outlines the specific process of translating decision solutions, comprised of client queues, server queues, and sequential queues, into a scheduling strategy. During this scheduling process, the algorithm also optimises the target task completion times and the fitness of individuals within the population. The pseudo-code for this algorithm is as follows:  
Initially, completion times are set to zero; that is, without any task allocation, the execution completion times for all clients \(C_{m}^{et}\) and servers \(S_{n}^{et}\) are initialized to 0. Thereafter, task allocation begins based on a sequential allocation principle. The first task \(X_{t}\) is retrieved from the set \(P=\{X_{t},X_{t^{\prime}},\ldots,X_{t^{\prime\prime}}\}\), and the assigned client \(C_{m}\) and server \(S_{n}\) are determined, along with their respective execution completion times \(C_{m}^{et}\) and \(S_{n}^{et}\). By comparing these two times, the start time of the task \(X_{t}^{st}\) is set as the maximum of the two, \(\max(C_{m}^{et},S_{n}^{et})\), ensuring that the task's start time does not precede the end time of the previous task on either the corresponding client or server. Following this, the task completion time is calculated as \(X_{t}^{st}+X_{t}^{T}\). The client execution completion time \(C_{m}^{et}\) and server execution completion time \(S_{n}^{et}\) are also updated to \(X_{t}^{st}+X_{t}^{T}\), facilitating subsequent calculations. Once a task is allocated, the next task in sequence from set \(P\) is selected and allocated following the same steps until all tasks are allocated. Ultimately, by comparing the completion times of all tasks, the maximum task completion time \(T_{1}\) and the average completion time of all tasks \(T_{2}\) are obtained. After determining the maximum task completion time, the fitness of the decision solution can be computed. This fitness calculation aims at two objectives, which are specifically:  
\[\text{Fitness}=\frac{1}{T_{1}+\gamma T_{2}} \tag{24}\]  
As previously mentioned, our decision solution must adhere to specific equipment and time constraints. The above scheduling solution satisfies the time constraints. However, further assessment is necessary to satisfy other optimization criteria. This involves verifying whether the assigned client can handle the task type (Line 15), whether the server is capable of handling the task type (Line 17), whether the task is running at the designated detection point (Line 19), and whether the server's deployment location meets the required conditions(Line 21). If all these conditions are met, the solution is deemed feasible, with the fitness set to:  
\[\text{Fitness}=\frac{\alpha}{T_{1}+\gamma T_{2}} \tag{25}\]  
Otherwise, the fitness is set to:  
\[\text{Fitness}=\frac{\beta}{T_{1}+\gamma T_{2}} \tag{26}\]  
where \(\alpha\gg\beta\). This setup facilitates the elimination of solutions that fail to meet the conditions. The details are outlined in Algorithm 1.