Skip to main content
. 2025 Apr 16;25(8):2502. doi: 10.3390/s25082502
Algorithm 7 Dynamic Event Handler
Input:
  • i: Index of the UAV that detected a dynamic event.

    U: UAVs’ information, including assigned task lists (a), capacity loads (L), and velocities (v).

    lidarReading: Information about the dynamic event.

Output:
  • U: Updated UAVs’ task assignments.

  •  1:

    if lidarReading == Detecting a new Task then

  •  2:

        newTasks Newly detected task(s) by Ui

  •  3:

        Assign newTasks to idle UAVs if available; otherwise, invoke Algorithm 8 for reassignment.

         (UAlgorithm8(i,U,newTasks))

  •  4:

    end if 

  •  5:

    if lidarReading == UAV failure then

  •  6:

        newTasks Unperformed tasks from ai

  •  7:

        Remove Ui from U

  •  8:

        Assign newTasks to idle UAVs if available; otherwise, invoke Algorithm 8 for reassignment.

         (UAlgorithm8(i,U,newTasks))

  •  9:

    end if 

  • 10:

    if lidarReading == UAV idleness then               ▹ai=

  • 11:

        if Unassigned or newly detected tasks exist then

  • 12:

            Assign available tasks to Ui.

  • 13:

        else if All tasks are assigned but some UAVs are overloaded then

  • 14:

            Ui assists the most loaded UAV in the same cluster.

  • 15:

        else

  • 16:

            Direct Ui to assist the nearest uncovered cluster.

  • 17:

        end if

  • 18:

    end if