Skip to main content
. 2021 Apr 1;21(7):2443. doi: 10.3390/s21072443
Algorithm 1 Receiving Beacon
  • 1:

    procedureReceiving_Beacon(beacon* bsm)

  • 2:

        His_Pos←BSM.SenderPos();

  • 3:

        Dist←Calc_Dist(My_Pos,His_pos);

  • 4:

        if ((Dist<=GeneralNR)OR((Dist<=RoadNR)AND(MyRoadID=HisRoadID)) then

  • 5:

            His_Speed←BSM.SenderSpeed();

  • 6:

            Speed←Max(My_Speed,His_Speed);

  • 7:

            if (Dist<=CloseNR) then

  • 8:

               Close←TRUE;

  • 9:

            end if

  • 10:

        end if

  • 11:

        Process_Beacon(BSM);

  • 12:

    end procedure