Skip to main content
. 2014 Jul 21;14(7):12990–13005. doi: 10.3390/s140712990
Algorithm 1. Pseudo code of HBSTR-Tree insertion algorithm.

Algorithm 1 Description: HBSTR-Tree Insertion Algorithm

Input: Tuple (inserted trajectory point), HBSTR (existing index structure), Tthres (time threshold for continuous trajectory), Tcnode (time threshold for cache clearance)
Output: updated index

1. Search in Hash for the node corresponding to OID, TNode.
2. If Time–EndTime (TNode) < Tthres Then
3. Insert Tuple into TNode
4. If TNode is not full Then
5. Exit
6. End If
7. End If
8. Use node-choosing sub-algorithm (Algorithm 2) to pick out the most suitable node in Level 1 of Rtree, Father, as the father of TNode and then insert TNode into Father
9. If Father is overflown Then
10. Use node-splitting sub-algorithm to divide child items of Father into two small nodes. This operation may lead to the overflow of upper-level nodes, and then recursively handle it even till root node
11. End If
12. OID and StartTime, which are the attributes of TNode, are combined as an index key OID/StartTime and inserted into Btree as an index entry
13. Create a new leaf node, and append Tuple to it. Then replace TNode with this new leaf node in Hash
14. Make a statistics for the number of nodes in cache, called NodesNum. If NodesNum surpasses the threshold, clear away the nodes in cache which have not been accessed for Tcnode