Research Article

Location Prediction-Based Data Dissemination Using Swarm Intelligence in Opportunistic Cognitive Networks

Algorithm 4

computes the intimacy value between two nodes at encounter time .
Input:   ,
Output:  
(1)define   the system running time
(2)     encounter time interval threshold
(3)    Contact vector array (, , )
(4) initialization: , () = 0, ;
(5)forall   ;
(6)if   recieve HELLO from
(7)    = ++;
(8)   for all  
(9)    ;
(10)     += ;
(11)    ;
(12)     += ;
(13)    ;
(14)    if  ()
(15)    ++;
(16);
(17)    end if
(18)  end for
(19)end if
(20)end for
(21)if  ()
(22)return  
(23)else
(24)return  
(25)end if