Research Article

A Method for Driving Route Predictions Based on Hidden Markov Model

Algorithm 2

Hidden_State_Sequence (a training set ).
Input: A training set .
Output: A hidden state sequence set QS.
(1) Hidden state sequence set QS = ;
(2) for (int ; ; ++)
 /∗   is the number of routes in . ∗/
(3)  Starting point ;
(4)  End point ;
(5)  Vector ;
(6)  for (int ; ; ++)
(7)   Starting point ;
(8)   End point ;
(9)   Vector ;
(10)   if ()
(11)    foreach (Coordinate point in )
(12)     foreach (Coordinate point in )
(13)     If ()
(14)      Insert a symbol into corresponding to the coordinate point;
(15)   else
(16)    foreach (Coordinate point in )
(17)     If ( is a symbol “<” or “>”)
(18)      Insert a symbol • into corresponding to the starting and end point;
(19)     else
(20)      Insert a symbol into corresponding to each coordinate point;
(21)  Insert each hidden state sequence into the sequence set QS