Skip to main content
. 2023 Jan 3;23(1):531. doi: 10.3390/s23010531
Algorithm 5 Send a BSM
  • 1:

    procedureShould_I_Send_a_BSM()

  • 2:

        if (vi has a Car_type of “role vehicles” or “public transport vehicles”) then

  • 3:

                Send_the_BSM_Message();                   ▹ these two kinds of vehicles always broadcast

  • 4:

        else if ((the number n_Neighbor is ≥k_sft) AND (Front_1 OR Front_2) AND (Rear_1 OR Rear_2)) then

  • 5:

                Delete_the_BSM_Message();

  • 6:

                if (My_set.size() == 0) then

  • 7:

                        Set_novelty_ratio=0;

  • 8:

                else

  • 9:

                        Set_novelty_ratio= 1 - My_final_set.size() / My_set.size();

  • 10:

                end if

  • 11:

        else

  • 12:

                Send_the_BSM_Message();

  • 13:

        end if

  • 14:

        My_set.clear();                              ▹ a reinitialization for the next timeslot

  • 15:

        My_final_set.clear();                          ▹ a reinitialization for the next timeslot

  • 16:

    end procedure