| Algorithm 1. Stationary data Classifier |
| Procedure Classifier_ Stationary_Data (Qr , N, Cr) Input data: Qr: set of position data obtained by vehicles operating line services on route r. N: number of classes to be classified. Cr: set of initial approximations to centroids. Output data: Cr,T: centroids representing each of the classes of GPS stationary data. Initial values: Zr = Ø; Step 1: Obtain Zr which is the set of GPS stationary data on route r: For each RAVL position reading belonging to Qr, if RAVLvel = 0 then include RAVL in Zr. End if Done Step 2: Classifying by procedure K_means_classifier (Zr, n, Pr, Zr, Cr) Input data: Zr: set of stationary data to be classified. n: number of stops on the route. Pr: positions of the n stops on route r. Output data: n Zr clusters n Cr centroids of each cluster K_means_classifier (Zr, n, Pr, Zr, Cr ) Step 3: Identifying the resulting clusters For each Zr,i resulting cluster, where 1 ≤ i ≤ n If Zr,i cluster contains no stop then Label the cluster as an unscheduled stop point. End if If Zr,i contains one and only one stop p on the line then Select Zr,i as the set of readings to obtain the time of arrival at the stop on the line service of route r. End if If Zr,i contains k stops and k > 1 then: Classifier_ Stationary_Data (Zr,i, k, Cr,i) Where: Zr,i: the GPS stationary data belonging to class i. k: number of stops in cluster i. Cr,i: positions of the k stops in Zr,i. End if Done |