Skip to main content
. 2019 Feb 22;19(4):921. doi: 10.3390/s19040921
Algorithm 2 The FRS algorithm.
  • Require: 

    W,T,Umax;

  • Ensure: 

    M;

  • 1:

    ListWT← mix W,T;

  • 2:

    shuffle ListWT;

  • 3:

    θ←ln(Umax+1)

  • 4:

    i=0,1,⋯,θ−1,wi=1,SumW=∑iwi,pi=wiwiSumWSumW

  • 5:

    for each object∈ListWT do

  • 6:

     if object is worker then

  • 7:

      CandidateList← Find a list of workers who are friends with the object in the system

  • 8:

      if CandidateList is not Null then

  • 9:

       for each candidate∈CandidateList do

  • 10:

        Calculate the time relationship strength between candidate and object

  • 11:

        Calculate the geographical relationship strength between candidate and object

  • 12:

       end for

  • 13:

       Get the categories of tasks that workers having the strongest relationship with object in CandidateList have performed and allocate this kind of task to object

  • 14:

       Add to M

  • 15:

      else

  • 16:

       Randomly choose one as the k value from 0,1,⋯,θ−1 according to the probability pi

  • 17:

       Allocate tasks that meet all constraints and utilities of the allocation are higher than ek

  • 18:

       Add to M

  • 19:

       ωk=ωk(1+δ)ukukUmaxUmax

  • 20:

       Update SumW and pi

  • 21:

      end if

  • 22:

     else

  • 23:

      Append to AppearTaskList

  • 24:

     end if

  • 25:

    end for