# A Discrete Particle Swarm Optimization Algorithm for Dynamic Scheduling of Transmission Tasks
## 3 Methodologies
### Algorithm Description  
1. Definition of particle position: in combination with the DSTT and the example, see Formula (15) for the definition of particle position. \[X_{i}=\big{(}x_{i1},x_{i2},\ldots,x_{ij},\ldots,x_{in}\big{)},i=1,2,\ldots,K, \ x_{ij}=Task_{j}.TransNo\ \ n=TaskNumber\] (15)  
where \(K\) represents the population size, \(TaskNumber\) represents the number of tasks, and \(Task_{j}.TransNo\) represents the equipment code assigned to the \(j\)-th task. In Figure 2, the particle position is the allocation result of 8 tasks, and each number represents the equipment code assigned to the task. The queue is {1,3,0,2,3,3,1,2}, and each number is the equipment code assigned to each task. The definitions of particle best and global best are the same as the definition of particle position, which is recorded as:  
\[Pbest_{i}=\Big{(}p_{i1},p_{i2},\ldots,p_{ij},\ldots,p_{in}\Big{)},i=1,2,\ldots,K \quad p_{ij}=Task_{j}.TransNo \tag{16}\]  
\[Gbest=\Big{(}g_{1},g_{2},\ldots,g_{j},\ldots,g_{n}\Big{)},\quad g_{i}=Task_{j}.TransNo \tag{17}\]
2. Definition of particle-motion direction: in combination with the characteristics of data discretization in DSTT, there is no direct association management between each task. Binary processing is adopted when defining particle-motion direction, that is, each particle-motion direction is each task that can change the equipment, and is recorded as: \[VD_{i}=\big{(}vd_{i1},vd_{i2},\ldots,vd_{ij},\ldots,vd_{in}\big{)},i=1,2,\ldots,K\quad vd_{ij}=0,1\] (18)  
Only one of the \(vd_{ij}\)'s sequence values represented by each \(VD_{i}\) is 1, and the other is 0. Position 1 represents the task of replacing the node when the particle in _Schedule_ updates the position, that is, the motion direction of the particle in _Schedule_. For example, \(VD_{i}=(0,0,0,1,0,0,0,0)\) indicates that the \(i\)-th particle in the population needs to replace the equipment working on Task2. 3. Definition of particle-motion target: the velocity displacement is defined as the serial number of the equipment to be replaced by the node representing the motion direction of particles in _Schedule_. The particle-motion target suitable for the operation of DSTT is defined as \(VT_{i}\), which is recorded as: \[VT_{i}=\big{(}vt_{i1},vt_{i2},\ldots,vt_{ij},\ldots,vt_{in}\big{)},i=1,2, \ldots,K,vt_{ij}=-1,TransNo\] (19)  
Only one value of each \(VT_{i}\) represented by sequence \(vt_{ij}\) is recorded as \(TransNo\), and the others are recorded as \(-1\). The value taken by \(TransNo\) indicates that the node is replaced by the representative emission equipment when the particle in the _Schedule_ updates its position, that is, the replacement target encoded by the particle's position in the particle's motion direction is defined as the particle-motion target in the _Schedule_. For example, \(VT_{i}=(-1,-1,-1,3,-1,-1,-1)\) indicates that the \(i\)-th particle in the population wants to replace the equipment2 working on task3 with equipment3. An example of particle motion is shown in Figure 3.  
Combining the problem characteristics of DSTT, particle motion has only one motion direction and target in order to ensure that the particle update of the DPSO have the characteristics of inertia preservation, particle best, and global best direction vector calculations included in the basic PSO. The DPSO uses a probabilistic-selection model to handle particle  
Figure 3: Example of particle motion. updates, and determines the proportion of parameters by which particles choose one of the three directions to perform motion operations. If the result of the probabilistic-selection model is inertia retention or the particle-motion target is consistent with the current position, random-perturbation processing is introduced to increase the population particle's diversity and avoid entering the local-optimal trap. 4. Definition of particle-position update: according to the characteristics of DSTT, the operation of particle-velocity update is to calculate the motion direction of particles and the motion target of particles.