Skip to main content
. 2017 Jun 14;17(6):1382. doi: 10.3390/s17061382
Algorithm 2 Class engagement analysis (CEA) algorithm.
Input: A new LCC message id,desc,time,loc, hash table HT, location q, time length T, small positive number ε.
Output: Hash table HT with the engagement ratio r.
if id is not a key in HT then
  if locq AND desc = LAS then
   TLAST; TLISε;
  else if locq AND desc = LIS then
   TLAS0; TLIST;
  rTLASTLIS;
  Insert a new key-value pair (id, [q,r,TLIS]) into HT;
else if id is an existing key in HT then
  Get the value [q,r,TLIS] from HT using id;
  if locq AND desc=LAS then
   rrTLIS+TTLIS;
  else if locq AND desc=LIS then
   rrTLISTLIS+T; TLISTLIS+T
  Update the latest key-value pair (id, [q,r,TLIS]) into HT;