# System Proposal for Mass Transit Service Quality Control Based on GPS Data
## 5 System Overview
### The SQCM
#### 5.2.1 The Improved Transport Network Model
For our system, this integrity is achieved by executing filtering rules: the first, to eliminate from the \(RAVL_{\tau,T}\) set those records containing position data that are not good quality; the second, to remove those records that are not part of a sequence of position readings that represent a complete and consistent route. \(RAVL_{\tau,T}\) records with low-quality GPS data are eliminated using the fields that indicate the age of the data, \(RAVL_{Age}\), and type of data, \(RAVL_{Sou}\); thus the RAVL record is deleted if either of the following two conditions are met:

* The data are old, i.e., \(RAVL_{Age}=1\), or no information is available for the age of the data, i.e., \(RAVL_{Age}=0\). * Information on the type of data obtained (2D or 3D) is not available, i.e., \(RAVL_{Age}=0\). \(RAVL_{\tau,T}\) records that are not part of a complete and consistent route \(r\) are eliminated by checking that the sequence of RAVL records obtained for each line service \(l_{i}\in L_{\tau,T}\) is complete, and that it represents a route consistent with route \(r\), i.e., it passes through all the stops and in the planned order. In formal terms:

* The line service is \(l\in L_{\tau,T}\), and \(AVL_{\tau,Tl}\) is the set of position data obtained during line service \(l\), where \(l_{T0}\) and \(l_{T1}\) are the start and end times of line service \(l\), respectively, and \(Q\) the sampling period used to record the RAVL data during operation of the service. The data sequence \(RAVL_{\tau,Tl}\) is then complete if the number of records in this sequence, \(NAVL_{\tau,Tl}\) is: \[NAVL_{\tau,Tl}=\frac{(l_{T1}-l_{T0})}{Q}\]
* \(C_{\tau,Tp}=\{c_{0},c_{1},\ldots,c_{n}\}\) is the ordered set of centroids associated with each of the stops along route \(r\). The route represented by \(RAVL_{\tau,Tl}\) data is thus consistent with route \(r\) if: \[\forall c_{i}\exists!RAVL:Dist\big{(}RAVL_{p},c_{i}\big{)}\leq U,\] where \(Dist\) is the distance between two points, \(RAVL_{tp}\) the position logged in a \(RAVL\in RAVL_{\tau,Tl}\) record, and \(U\) a distance threshold representing proximity. This value depends on the maximum GPS error accepted by the system, \(E\), the length of the parking space at the bus stop, the maximum speed that the vehicle may attain and the time period used by the vehicles to acquire their GPS position data. As a result of this step, an integral set of RAVL records is obtained, i.e., data containing position data of good quality and representative of line services on route \(r\) that are complete and consistent with route \(r\) as planned. Hereinafter, this set will be represented by \(QAVL_{\tau,T}\). Similarly, the set of reliable data obtained during a line service \(l\), on route \(r\) and operated during the period \(T\) will be represented by \(QAVL_{\tau,Tl}\). #### 5.2.4 Step 3: Obtaining Passing Times

Once the \(QAVL_{\tau,T}\) set has been obtained, the next step is to obtain the position data captured at the time that the vehicle arrives at each of the stops. To this end, the system partitions the \(QAVL_{\tau,T}\) set into subsets of \(QAVL_{\tau,Tl}\) data. If the position data for each of these \(QAVL_{\tau,Tl}\) subsets are ordered on an ascending scale according to the time that each record was obtained, we would have a representation of a complete and consistent route \(r\) operated by the vehicle in question. The passing times for each of the stops on each of these \(QAVL_{\tau,Tl}\) routes, which will be represented by the ordered time sequence \(AT_{\tau,Tl}\), will be obtained considering two different cases:* Case A: the vehicle passes stop \(p\) and does not stop. This case occurs when there are no passengers waiting to board the vehicle at \(p\), and no passengers on the bus who want to alight at \(p\). In this case, the passing time for this stop is obtained by finding the position for the \(QAVL_{\tau,T,l}\) set that is at a minimum distance from the position of stop \(p\).