Skip to main content
. 2021 Oct 15;21(20):6862. doi: 10.3390/s21206862
Algorithm 2 Offline algorithm for sensor scheduling.

Input:πl, AG, Em, Tl,hj

  From CRM KB:

πl: the choices of groups of sensors G for each of the requested L contexts

AG: the accuracy of group G

Em: the energy consumption by each sensor Sm

  From User Behavior:

Tl,hj: the time limits of the context states xlj

Output:aGi, EGj, DGj

 aGi: the sensing schedules for the sensor groups in πl recognizing each context.

 EGj: the energy consumption for each group of sensors G recognizing context state xlj

 DGj: the delay of each sensor group G in recognizing context state xlj

  • 1:

    for each sensor group Gπl do

  • 2:

      Calculate EG as the sum of Em of SmG

  • 3:

      for each context state xlj do

  • 4:

       for each (α,β) pair do

  • 5:

        Run Viterbi algorithm to determine sensing schedule for G in recognizing state xlj

  • 6:

        Compute the objective function value according to (12)

  • 7:

        Track the resulting energy consumption, delay, and the (α,β) pair for the derived sensing schedule.

  • 8:

       end for

  • 9:

       Store the sensing schedule with the minimum objective function value according to (12) and the associated energy consumption (EGj), delay (DGj), and (α,β) pair in the Look-Up Table (LUT)

  • 10:

      end for

  • 11:

    end for