# A Discrete Particle Swarm Optimization Algorithm for Dynamic Scheduling of Transmission Tasks
## 3 Methodologies
### Algorithm Description
The evaluation value of each particle task is calculated according to the particle position, and \(XV_{i}\) is recorded as: \[XV_{i}=\left(xv_{i1},xv_{i2},\ldots,xv_{ij},\ldots,xv_{in}\right),i=1,2,\ldots,K\ \ \ xv_{ij}=Va_{x_{ij}Task_{j}.Freqband}\] (20) where \(x_{ij}\) is the equipment code currently assigned to the \(j\)-th task represented by the \(i\)-th particle in the particle-position definition, \(Va_{x_{ij}Task_{j}.FreqBand}\) represents the evaluation value in _ValueMatrix_ when the \(j\)-th task is executed by the \(x_{ij}\) equipment, and \(Task_{j}.Freqband\) represents the frequency-band code of the task. Similarly, the evaluation-value sequence of particle best and global best is recorded as \(PbestV_{i}\), \(GbestV\): \[PbestV_{i}=\left(pv_{i1},pv_{i2},\ldots,pv_{ij},\ldots,pv_{in}\right),i=1,2, \ldots,K\ \ \ pv_{ij}=Va_{p_{ij}task_{j}.FreqBand}\] (21) \[GbestV=\left(gv_{1},gv_{2},\ldots,gv_{i},\ldots,gv_{n}\right),\ \ \ gv_{i}=Va_{g:Task_{j}.FreqBand}\] (22) where \(p_{ij}\) is the equipment code assigned to the \(j\)-th task indicated in the definition of the particle-best position of the \(i\)-th particle. The \(Va_{p_{ij}Task_{j}.FreqBand}\) indicates the evaluation value in _ValueMatrix_ when the \(j\)-th task is executed on the \(p_{ij}\)-th equipment, the \(Task_{j}.FreqBand\) indicates the frequency-band code of the task. The definition of global best is consistent with that of particle best. Calculate the evaluation-value gap between the particle-position and the particle-best values based on the difference between the above two evaluation value data series, and calculate the evaluation-value gap between the current particle and the global-best value based on the difference between the two data series. Select the maximum difference in evaluation values as the motion-direction option of particles. Whether the particle moves towards the particle best direction or the global best direction depends on the output of the probability-selection model. The equipment code of particle best and global best directions is used as the motion target of particles. For example, the output of the probability-selection model is the global-best direction. Compare and calculate \(XV_{i}\) and \(GbestV\). When \(j=L\), \(Va_{g;Task_{j}.FreqBand}-Va_{x_{ij}Task_{j}.FreqBand}\) is at maximum value, then \(L\) is the motion direction of particles. The motion direction is \(VD_{i}=(0,0,\ldots,1,\ldots,0)\) where only the \(L\)-th value is 1, and the other value is 0. The motion target is \(VT_{i}=(-1,-1,\ldots,Task_{L}.TransNo,\ldots,-1)\) where only the \(L\)-th value is \(Task_{L}.TransNo\) of \(Gbest\), and the other value is \(-1\). Combined with DSTT, \(Task_{L}.TransNo\) is the equipment code assigned to the \(L\)-th task with the largest difference between the particle position and the global best. In DSTT, the goal of fitness function is the maximum evaluation value. The \(D\)-value between the evaluation values calculated before and after particle iteration can be understood as the motion distance of the particle.