# A Project Scheduling Game Equilibrium Problem Based on Dynamic Resource Supply
## 4 Algorithm Design
### Diwso
#### 4.2.3 Updating Policies  
Step 1. Before the update operation, individuals are selected based on the elite strategy to increase the running speed of the algorithm. That is, the fitness of individuals generated in the population is first sorted from largest to smallest, and the top 50% of individuals are retained. Step 2. DIWPSO is used for updating. Although the standard PSO has a fast convergence speed in the early stage, it is slow in later stages and easily converges locally. Therefore, this algorithm is improved from the perspective of the inertia weight. The inertia weight \(\omega\) indicates the extent to which the original speed is retained; if \(\omega\) is larger, the global search ability is stronger, and if \(\omega\) is small, the local search ability is strong. The update strategy is as follows: in the position vector, Equations (26) and (27) are used to update the particle velocity and position for the continuous factor \(v_{isk}(t)\):  
\[v_{id}(\tau+1)=v_{id}(\tau)\omega+c_{1}r_{1}(\tau)[p_{id}(\tau)-x_{id}(\tau) ]+c_{2}r_{2}(\tau)[g_{d}(\tau)-x_{id}(\tau)] \tag{26}\]  
Figure 3: Variation operation diagram. \[x_{id}(\tau+1)=x_{id}(\tau)+v_{id}(\tau+1) \tag{27}\]  
\[\omega=\omega_{min}+(\omega_{max}-\omega_{min})*e^{-\frac{\tau}{max}}+\sigma* betarnd(p,q) \tag{28}\]  
where \(\tau\) represents the current iteration number; \(\tau_{max}\) represents the maximum number of iterations; \(\omega_{max}\) represents the maximum inertia weight, which is set to 0.9; \(\omega_{min}\) represents the minimum inertia weight, which is 0.1; \(\sigma\) is the inertia adjustment factor, which is 0.1; \(p=1,q=3\); \(c_{1}\) and \(c_{2}\) are learning factors; \(r_{1}\) and \(r_{2}\) are uniform random numbers between [0,1]; \(x_{id}(\tau)\) and \(v_{id}(\tau)\) represent the position and velocity of the \(d\) dimension elements, respectively, of the \(i\) particle after the \(\tau\) iteration; \(p_{id}(\tau)\) represents the individual optimal position of the \(i\) particle in the \(d\) dimension; and \(g_{d}(\tau)\) represents the global optimal position of all particles in the \(d\) dimension. \(\omega\) in the update strategy is an improved strategy for the dynamic adjustment of inertia weight [33], and the exponential function is used to control the change in inertia weight \(\omega\). With an increase in the number of iterations, \(e^{-\tau/\tau_{max}}\) decreases nonlinearly; thus, \(\omega\) can ensure the breadth of global search in the early stage and gradually decrease in the later stage to improve the ability of the local search and ensure its accuracy. Betarnd is a random number generator in MATLAB that can generate random numbers in line with the beta distribution. In addition, an inertia adjustment factor \(\sigma\) was added to control the deviation of the inertia weight, to make the adjustment more reasonable. Step 3. Particle evaluation. To avoid generating infeasible particle positions and excessive velocities during the iteration, they must be within the corresponding limits. \[v_{id}=\left\{ \begin{array}{l}v_{\max},v_{id}>v_{\max}\\ v_{\min},v_{id}<v_{\min}\end{array} \right.,x_{id}=\left\{ \begin{array}{l}x_ {\max},x_{id}>x_{\max}\\ x_{\min},x_{id}<x_{\min}\end{array} \right. \tag{29}\]  
Step 4. Particle adjustment. Since the fitness function is designed with the belief that larger is better, the individual \(P_{i}(\tau)\) and the global \(G(\tau)\) optimums are updated by calculating the fitness of the particles. Step 4.1. For the individual optimum \(P_{i}(\tau)\), if \(Fitness[Y_{i}(\tau)]>Fitness[P_{i}(\tau-1)]\), update \(P_{i}(\tau)=Y_{i}(\tau)\); otherwise, maintain the original value. Step 4.2. For the global optimum \(G(\tau)\), if \(Fitness[P_{i}(\tau)]>Fitness[G(\tau-1)]\), update \(G(\tau)=P_{i}(\tau)\); otherwise, maintain the original value, namely \(G(\tau)=G(\tau-1)\). Step 5. Premature particle determination. To judge the convergence degree of the particles, the population fitness variance [34] was introduced as the judgment mechanism of particle prematurity.