Features of programming algorithms and data structures for traffic forecasting
DOI:
https://doi.org/10.31891/2307-5732-2024-331-38Keywords:
algorithm, data structure, programming, software, database, traffic forecastingAbstract
Development of software system for monitoring and forecasting of vehicle traffic is considered in the paper. Possible ways of data structures and storages organization for such a system were analysed. Implementation features of these data structures for Python programming language were considered based on the NumPy, Pandas packages. Special attention was paid to the application of lists, multidimensional arrays and dictionaries as data structures and files of different types as data storages. Web application was developed based on the Django web development framework. The corresponding database structure was proposed and presented for data storage organization. The developed web application supported calculation of time necessary for realization of different scenarios. These scenarios define implementation of data structures based on the corresponding algorithms in software system. Data storages were filled with observation data, accumulated in Madrid through the period from 1.01.2019 to 30.09.2022. 59 stations were used to measure vehicle traffic. Base monitoring scenarios include data reading and selection. Vehicle traffic forecasting is done under resource constraints. Data is prepared in the form of time series, as well as in the form necessary for selection of informative stations. Search speed acceleration was provided through the creation of indexes. Recommendations were given for design decision making concerning choice of data structures for support of different variants of software system application. Data, previously structured as lists and dictionaries, makes an effective foundation for data selection and preparation. If data has to be read from a file at the beginning of a corresponding operation, then software communication with database is a more appropriate approach.