Skip to main content
. 2025 Dec 2;25(23):7332. doi: 10.3390/s25237332
Algorithm 1 Pseudocode of the Multi-Peak Dynamic Switching Control Scheme for SIL-IoT
Require: tm, f(tm), SOC0
Ensure: αtm, T, Nq, SOCtm, Best f(tm)
  •   1:

    Create initial population

  •   2:

    for  αi[0,1] do

  •   3:

        αtm=α1,α2,,α11

  •   4:

        Toni=111αi

  •   5:

        Toff11Ton

  •   6:

        Xi[xi1,xi2,,xid]

  •   7:

        Vi[vi1,vi2,,vid]

  •   8:

        if Ton>0 and SOC0>10% then

  •   9:

            Statistical analysis of pest phototactic rhythm

  • 10:

            f(tm) according to the Equations (1)–(5)

  • 11:

            Calculate energy consumption

  • 12:

            Eik1 according to the Equations (6)–(13)

  • 13:

            F(tm)αi(γf(tm)βE(tm))

  • 14:

        end if

  • 15:

        Xik+1Xik+Vik+1 {according to the Equations (21)–(26)}

  • 16:

        while Eik1Ethreshold do

  • 17:

            SOCiSOC0SOCi1

  • 18:

            if SOCi>10% then

  • 19:

                F(tm)αiWk1

  • 20:

                InsecticidalRate ← Calculate insecticidal rate

  • 21:

                OperationTime ← Calculate operation time

  • 22:

                αtm Find optimal switching state {according to the Equations (14)–(20)}

  • 23:

            end if

  • 24:

        end while

  • 25:

    end for

  • 26:

     

  • 27:

    return αtm, T, Best F(tm)