# Scenario-Based Emergency Material Scheduling Using V2X Communications
## SEMS Method
### SEMS Algorithm  
The Artificial Fish-Swarm Algorithm (AFSA) is one of the swarm intelligence algorithms. It consists of a population of fishes interacting locally with one another and their environment by following rules. This algorithm has the advantages of high convergence speed, flexibility, fault tolerance and high accuracy [30].  
There are many swarm intelligence algorithms, such as particle swarm optimization (PSO), ant colony optimization (ACO), and bacterial foraging optimization (BFO). Particle swarm optimization is inspired by the social behavior among individuals, for instance, bird flocks. Particles representing a potential solution to the optimization problem move through a search space. Particle swarm optimization comprises a very simple concept, and paradigms can be implemented in a few lines of computer code [31; 32]. It requires only primitive mathematical operators, and is computationally inexpensive in terms of both memory requirements and speed. However, its disadvantage is premature convergence that leads to a fall into local optimum. Moreover, the values of parameters affect the operation of PSO greatly. Ant colony optimization was inspired by observations of the foraging behavior of real ants, which is applied to solve discrete combinatorial optimization problems [33]. The ants leave pheromone while traveling. The intensity of pheromone governs the movement of thewhole ant community. Subsequently, pheromone intensity becomes very high along the shortest path, and finally all ants will converge to the food. The convergence speed of ACO is relatively slow because the pheromone intensity is basically the same in the beginning and gradually the path with a higher pheromone intensity will be found, which will waste much time in the initial stage of computation. Local optimum is also a problem for ACO.  
After a disaster occurs, emergency material scheduling is very urgent. Thus, we need an algorithm with a high searching speed. The AFSA has a high convergence speed. Moreover, to solve the problem of local optimum, congestion factor is introduced into the AFSA. Congestion factor is an important parameter to constrain the excessive clustering behavior of fishes, which can avoid local optimum effectively. Therefore, we designed the SEMS algorithm based on the AFSA according to the following steps. The SEMS takes fairness as the main objective and transport time as the secondary objective.  
Step 1: Set parameters, including the fishes scale--fish num, the maximum number of foraging trials--try_number, the fish group perception distance--visual, the crowd factor delta, the moving step length--step, and the maximum iteration number--MAXGEN;  
Step 2: Artificial fish coding. Individual fishes are coded with real numbers and expressed as a matrix. Each artificial fish represents a plan for emergency material scheduling;  
Step 3: Initialization of the fishes. The current iteration number gen = 0. If the supply depot participates in a plan, the supply of emergency materials is a random positive number less than or equal to the storage amount, otherwise it is 0;  
Step 4: Evaluation of the fitness of each fish by performing foraging. This step is to solve the objective function, that is, to find the maximum fairness and minimum time while meeting the constraints;  
Step 5: Update the fitness by performing clustering and following behaviors. Each artificial fish performs clustering and following behaviors individually. If the existing value is optimal, it becomes the new optimal value, otherwise the fish continues foraging;  
Step 6: Check whether it reaches the maximum iteration number, MAXGEN. If yes, it outputs the optimal value, otherwise the variable gen adds one and the algorithm goes to step 3.  
The SEMS algorithm is illustrated in Figure 3.  
Figure 3: The SEMS algorithm.