IMOC: Optimization Technique for Drone-Assisted VANET (DAV) Based on Moth Flame Optimization
Algorithm 1: Intelligent moth flame clustering optimization for VANETs.
1. START
2. Define grid size
3. In the 2d grid random deployment of vehicular nodes
4. Broadcasted position of each node in the search space
5. Node IDs as vertex, mesh topology is formed
6. Assignment of values to edges in the mesh network by distance calculation of each node
7. Create search space of order, initialized moth position
8. When , loop from the total maximum number of search agents. FOR to the total number of dimensions where starts from 1
9. Position of each moth updated by moth position () = upperbound minus lowerbound both starts from I divided by node position in the grid plus lower-bound
10. End loop
11. If simulation stalled or ended (20 iterations)
12. FOR moth to flame size and starts from 1
13. Calculation of fitness of moth_position (MP) as moth fitness = fitness_function (); fitness moth_position (MP) calculated
14. WHILE node list NOT empty for clustering nodes
15. Allocation of the best solution to moth with cluster fitness of each moth less than the finest result
16. END_WHILE
17. END_FOR
18. Sorted_fitness (), sorting fitness values of all moths
19. Population_sorted () w.r.t sorted_fitness () population is sorted
20. Among the updated fame position, the best obtained till now
21. Best flame_score = sorted_fitness (1);
22. Best flame_position = population_sorted (1, :)
23. Update moth position-based on the corresponding flame
24. FOR from one to maximum search_agents
25. FOR from one to total dimensions
26. Compute distance for th-moth for th-flame; equivalent to absolute (population_sorted () − MP ());
27. Moth location update
28. END_FOR
29. END_FOR
30. IF convergence_curve = convergence_curve iteration no 131. stall iteration++;
32. ELSE
33. stall_iteration =0;
34. END_IF
35. Iteration++;
36. END loop
37. Best solution from search is equal to total number of
38. END
Algorithm 1: Intelligent moth flame clustering optimization for VANETs.