4.2.1. Initial Code

In the existing research results, when solving the problem of resource transportation, the coding method mostly adopts the integer representation method, in which the customer (demand point) and the virtual distribution center are arranged together. In this study, the resource allocation quantity on the transportation path is adopted as the real number coding. Let *Y* = *visk*(*t*) represent the position vector of each particle, initialize *i* particles as a population, and generate the *i*th particle with *d*-dimensional position vector *Yi*; let its initial velocity *Vi* = 0, then the initial individual optimal is *Pi* = *Y*<sup>1</sup> *<sup>i</sup>* . The initial population is generated randomly so that it is distributed uniformly in the entire solution space as much as possible.
