Skip to main content
. 2018 Aug 25;18(9):2802. doi: 10.3390/s18092802
Algorithm 1 Automatic Rule Generator
  • 1:

    Tempoutdoor {L,M,H}

  • 2:

    Tempindoor {L,M,H}

  • 3:

    Humidityrel {L,M,H}

  • 4:

    Prates {OP,MP,HP}

  • 5:

    Occ {A,P}

  • 6:

    ISPs {L,M,H}

  • 7:

    for Humidityrel[1] to Humidityrel[n] do

  • 8:

        for Tempoutdoor[1] to Tempoutdoor[n] do

  • 9:

            for Tempindoor[1] to Tempindoor[n] do

  • 10:

               for Prates[1] to Prates[n] do

  • 11:

                   for ISPs[1] to ISPs[n] do

  • 12:

                       for Occ[1] to Occ[n] do

  • 13:

                           Compute Score          ▹ Defined in Equation (9)

  • 14:

                           if Score = 0 or Score = 1 then

  • 15:

                              EC = VL

  • 16:

                           else if Score = 2 or Score = 3 then

  • 17:

                              EC = L

  • 18:

                           else if Score >= 4 and Score <= 7 then

  • 19:

                              EC = M

  • 20:

                           else if Score = 8 or Score = 9 then

  • 21:

                              EC = H

  • 22:

                           else

  • 23:

                              EC = VH

  • 24:

                           end if

  • 25:

                       end for

  • 26:

                   end for

  • 27:

               end for

  • 28:

            end for

  • 29:

        end for

  • 30:

    end for