Skip to main content
. 2024 Apr 4;24(7):2295. doi: 10.3390/s24072295
Algorithm 1 Transitions between states.
  • 1:

    procedure Transition(threshold_Tor,threshold_nonTor,feature_set,batch_size)                 ▹ Function

  • 2:

        for i in range(0, len(feature_set), batch_size) do

        // Create batches

  • 3:

            batch_features=feature_set[i:i+batch_size]

        // Calculate reward value of each sample in the batch

  • 4:

            r_batch=first_action(batch_features)

  • 5:

            for j in range(len(batch_features), batch_size) do

  • 6:

               if r[j]>=threshold_tor then                          ▹ Classified as Tor

  • 7:

                   StateTor

  • 8:

               else if r[j]<=threshold_non_tor then                  ▹ Classified as non_Tor

  • 9:

                   StateNon_Tor

  • 10:

               else                                ▹ Classified as Ambiguous

  • 11:

                   while r[j]>threshold_non_torandr[j]<threshold_tor do

  • 12:

                       if noactionsremaininginactionspace then

  • 13:

                           Label(Anonymous&&Malicious)              ▹ Further processing required

  • 14:

                           break

  • 15:

                       StateAmbiguous

  • 16:

                       r_batch=next_action(batch_features)                ▹Selectnextaction