Research Article
Information Transmission Probability and Cache Management Method in Opportunistic Networks
Algorithm 1
Information Transmission Probability and Cache Management (ITPCM) algorithm.
Algorithm: Information Cache Management and Transmission | Input: node , node , cache , cache | Output: message List, probability | Begin | Create meeting list | While node and node meet | If (node . is TargetNode()) | send message to node; | Else if (!node .isTargetNode() and !cache is full() and ! cache . isfull()) | According to evaluate and message importance news; | Copy message from cache to node | End else if | End if | If (!node .isfull()) | If () | Then transfer cache .getMessage() to cache | End if | Else if (!node .isTargetNode() and node .isfull()) | then set location is node .selectCooperationNodeSet() | broadcast some location of message to location.isNeighborNode() | cache .deleteBroadcastMessage() | If (location.isEmpty()) | Then cache .deleteSomeMessage() | When node meet node of transfer message | End else if | End if | If (!cache .isfull()) | Probability = node .meetMessageTargetNode() | Probability = node .meetMessageTargetNode() | End if | If () | Transfer cache .getMessage() to cache | cache . deleteTransferMessage() | Output Message | End If | End |
|