## 4 Calculation of the Number of Vehicles Entering and Leaving the Car Park  
In the case of the indirect method some additional measurement uncertainties may appear (Figure 6), yet the cost of the occupancy-detecting equipment is lower.  
The uncertainty in determining the number of vehicles entering and leaving can be evaluated on the basis of methods commonly applied for such calculations. Thus, this paper does not present these methods. Sections 5 and 6 include a description of determining the characteristic measurement uncertainties for the presented method, determining car park occupancy uncertainty and determining car park occupancy duration uncertainty.  
Using the indirect method and based on the given measurements the following can be determined.  
The number of cars entering the rest area during the time of the measurement is  
\[n_{1(t_{1};t_{2})}=\sum_{t_{1}}^{t_{2}}e_{1(t_{1};t_{2})} \tag{1}\]  
The number of cars leaving the rest area during the time of the measurement is  
\[n_{2(t_{1};t_{2})}=\sum_{t_{1}}^{t_{2}}e_{2(t_{1};t_{2})} \tag{2}\]  
where the following stand for:  
* \(e_{1}\) and \(e_{2}\) are the instances of detecting the vehicle, respectively, at the entrance and exit of the rest area;
* \(t_{1}\) and \(t_{2}\) are, respectively, the initial and final time (moment) for determining the values.  
Figure 6: The distinction of the elements introduced uncertainty in determining the number of vehicles in the rest areas.  
These parameters allow one to specify the number of vehicles occupying the rest area for a given time between \(t_{1}\) and \(t_{2}\):  
\[N_{(t_{1};t_{2})}=n_{1(t_{1};t_{2})}-n_{2(t_{1};t_{2})} \tag{3}\]  
If the rest area was occupied by some vehicles before \(t_{1}\) which left before \(t_{2}\), the value might be negative.  
The number of vehicles in the rest area can be calculated in the following way:  
\[z=\frac{\sum\limits_{t_{3}}^{t_{4}}\left(\sum\limits_{t_{1}}^{t_{2}}e_{1(t_{1} ;t_{2})}-\sum\limits_{t_{1}}^{t_{2}}e_{2(t_{1};t_{2})}\right)_{(t_{3};t_{4})}}{ (1+C)\cdot\sum\limits_{t_{3}}^{t_{4}}e_{a(t_{3};t_{4})}} \tag{4}\]  
The calculated result (\(z\)) is the mean value of the vehicles in the rest area in the period between \(t_{3}\) and \(t_{4}\).  
C is the rest area equipment and location factor (in [35], it was taken from survey data, but in this simulation C = 0). In the formula, it is 1 + C because C is assumed to be the coefficient for improving the rest area's attractiveness (equipment and location). For example, rest area type 1 will have C = 0, and the rest area with the gas station will have, for instance, C = 0.2.  
The abovementioned formulas were the basis for the computer simulation of the change in parking space demand for a given time. The results for cars in this simulation are presented in Figure 7.  
Figure 7: The simulation results in the period of time from \(t_{3}\)_till_\(t_{4}\): (**a**) change in the parking space demand and (**b**) number of vehicles entering and leaving the car park.  
Meanwhile, Figure 8 shows the real results of the measurements conducted at one rest area within the RID (The National Centre of Research and Development) project [35].  
The descending tendency indicates a distortion of the measurements.