Skip to main content
. 2020 Jan 2;20(1):262. doi: 10.3390/s20010262
Algorithm 2 Simulation algorithm for SS process
  • 1:

    Initialize scheme, recollectingTime, R, slotTime, totalSlotTDMA=fracRP, ranuraTDMA=0, Nch, N, timeVertUAV, totalSlotTDMA=UAValtitudespeedVertUAV, visitCHs=false, visitCHuavo=false, L=100,000, consumed energies in SS;

  • 2:

    forl=0 to l<L do

  • 3:

    if scheme==WSNO then

  • 4:

      if slotTDMA<totalSlotTDMA then

  • 5:

       transmitTDMAwsno();

  • 6:

       energyConsumedTDMAwsno();

  • 7:

       slotTDMA++;

  • 8:

      end if

  • 9:

      if timeVertUAV<tiempoVertTotalUAV then

  • 10:

       vertFlightUAVwsno();

  • 11:

       energyConsumedVertUAVwsno();

  • 12:

      end if

  • 13:

      if visitCHwsno==false then

  • 14:

       horFlightUAVwsno();

  • 15:

       energyConsumedHorUAVwsno();

  • 16:

       if visited CHs by UAV == NCH then

  • 17:

        visitCHwsno=TRUE

  • 18:

        return UAV to BS;

  • 19:

       end if

  • 20:

      end if

  • 21:

    else

  • 22:

      if slotTDMA<totalSlotTDMA then

  • 23:

       transmitTDMAuavo();

  • 24:

       energyConsumedTDMAuavo();

  • 25:

       slotTDMA++;

  • 26:

      end if

  • 27:

      if timeVertUAV<tiempoVertTotalUAV then

  • 28:

       vertFlightUAVuavo();

  • 29:

       energyConsumedVertUAVuavo();

  • 30:

      end if

  • 31:

      if visitCHuavo==false then

  • 32:

       horFlightUAVwsno();

  • 33:

       energyConsumedHorUAVwsno();

  • 34:

       if UAV visits CHsink then

  • 35:

        visitCHuavoo=TRUE

  • 36:

        return UAV to BS;

  • 37:

       end if

  • 38:

      end if

  • 39:

    end if

  • 40:

    end for