Skip to main content
. 2019 Mar 8;19(5):1184. doi: 10.3390/s19051184
Algorithm 2 Dynamic context matching algorithm.
  • Input

  •  Context DynamicContext,PrivacyContext

  • Output

  •  The closest pc of the API call

  • Begin

  • similarity=0

  • result=null

  • for all pcPrivacyContext do

  •   if pc.api==DynamicContext.api then

  •    simTemp=Similarity(DynamicContext.stack,pc.context) //Calculate similarity

  •    if similarity<simTemp then

  •     similarity=simTemp

  •     result=pc// Update result

  •    else if similarity==simTemp then

  •     result.add(pc)// Add result

  •    end if

  •   end if

  • end for

  • return result