Trafﬁc Intersection Lane Control Using Radio Frequency Identiﬁcation and 5G Communication

: This article deals with automated urban trafﬁc management, and proposes a new comprehensive infrastructure solution for dynamic trafﬁc direction switching at intersection lines. It was assumed that the currently used solutions based on video monitoring are unreliable. Therefore, the Radio Frequency IDentiﬁcation (RFID) technique was introduced, in which vehicles are counted and, if necessary, identiﬁed in order to estimate the ﬂows on individual lanes. The data is acquired in real time using ﬁfth-generation wireless communications (5G). The Pots and Ising models derived from the theory of statistical physics were used in a novel way to determine the state of direction trafﬁc lights. The models were veriﬁed by simulations using data collected from real trafﬁc observations. The results were presented for two exemplary intersections.


Introduction
The Smart City concept refers often to the pursuit of various goals related to improving the living conditions of residents and enhancing the management of typical areas of city activities [1,2]. The current availability of modern technological means makes these aspirations take real shape. However, there are still areas important for Smart City that may still require improvement [3], such as traffic management, which is a big challenge for many cities [4,5]. Due to the densely built-up space, the road infrastructure may not always be expanded to accommodate increased traffic. It is often attempted to solve this problem by limiting access to separate zones, for example, to the very center of the city [6]. In many cities, hopes are also placed on the development of public transport. The infrastructure needed for vehicles with different propulsion systems (electric, petrol, emission-free, etc.) and associated privileges or restrictions are also be taken into account [2]. This paper proposes a new solution of urban traffic light control oriented at the intersection with many directional lanes. It is assumed here that the existing methods of obtaining data about vehicles based on vision systems [7] are insufficient or unreliable. The described system is based on two pillars, namely Radio Frequency IDentification (RFID) technology and wireless 5G communication. Thanks to RFID, it is possible to create a precise traffic measurement system that provides reliable data about each vehicle involved in the traffic at an intersection [8,9]. Data from the RFID transponders is read by sensors located in the road infrastructure and then further processed. 5G wireless communication technology is then used to send the RFID data in real time to the traffic control center, where an appropriate algorithm decides whether the vehicles are allowed to take a specific line at the intersection. This approach prompted the preparation of a model of the intersection taking into account the possibility of flexible setting of driving directions for lanes, depending on the driver's intentions.
Energies 2021, 14 Existing work on traffic light control uses different approaches. The authors of [10] present an artificial neural network set for decentralized traffic signal. The traffic lights at each intersection are independently controlled using real-time data from sensors installed along the lanes. The simulations showed a reduction in travel time and an increase in the average speed of vehicles. The authors of [11] used the reinforcement learning (RL) method implemented with the use of a neural network for adaptive traffic light control in complex urban traffic systems. A decentralized multi-agent RL (MARL) algorithm has been presented to solve the scalability problem. The multi-agent RL-based approach is also used in the DRLE edge computing framework [12] to minimize traffic congestion in a city. Internet of vehicles (IoV) and edge computing are used to control traffic lights on different levels. The proposed hierarchical algorithm results in a much smaller convergence time.
For the purpose of this paper, an application of models derived from the theory of statistical physics was used. The Ising model is primarily used for the analysis of phase changes [13][14][15]. Its initial application was in statistical mechanics and phase transitions in the magnetism model [16]. The Potts model [17] is the generalization of the Ising model, allowing more than two states to be considered, which widened the area of use. Currently, both models are used in many fields, including in the analysis of economic and social relations [18][19][20], or for modeling processes taking place in computer networks [21][22][23][24]. The great potential of these models was also noticed in the area of traffic modeling and traffic light control. In [25], the authors proposed an approach based on the principle of interaction of the nearest traffic lights with each other. They assumed a road with a sequence of lights and used a one-dimensional Ising model with two possible states, corresponding to north/south or east/west driving directions. A similar approach was adopted in [26], where red and green light corresponded to the up and down states in the Ising model. In their considerations, the authors adopted the theoretical model of network infrastructure in the form of a lattice. It should be noted that these approaches only involve a shift from red to green in an effort to avoid traffic congestion. In the work [27], D-Wave Systems' quantum annealer was used for the problem of optimal control of time-dependent road signals on an artificial road network with a grid structure. The aim of the solution is to prevent vehicles from having to stop at the next set of traffic lights and to increase the flow of traffic.
The analyzed studies confirm that random switching of lights may increase traffic jams. However, these solutions do not take into account the actual methods of collecting information about the current state of traffic. Only in [16], attention was paid to collecting basic data from sensors mounted on the road, but it was limited to information about the number of vehicles, and not about the direction of travel or the type of vehicle. This is especially important in the case of lanes that can be used for driving in different directions. Therefore, this paper proposes a comprehensive approach to the issue based on the Ising/Potts models. The latest available solutions based on RFID and 5G were taken into account as the basic mechanisms for collecting up-to-date information about vehicles and their direction of travel. The simulations were carried out for these models to illustrate their operation in situations where vehicles appear at various frequencies for different directions of travel. The simulations also distinguished the phases of traffic permission and lack of such permission. The results indicate the possibility of practical application of the proposed solutions to control traffic lights at intersections.

Smart Cities and Traffic
Smart City has become a very popular node in the idea of Society 5.0 alongside Industry 4.0, Humanity 4.0, and Communication Technologies 5.0 [28]. The latest version of the Smart City 3.0 node gives citizens the opportunity to participate in the process of making their city a better place to live. Thanks to the close cooperation of residents and city officials, it is possible to shape their city in a more citizen-oriented way [29,30]. In 2020, IoT analysts created the Smart City Use Cases & Technology Adoption Report based on 50 cities around the world and their needs. The report shows the important matters dealt with by city authorities, with many of the cities still in the Smart City 1.0 and 2.0 phase. Research results indicate that categories related to mobility and transport are the most important issues that have been addressed by smart cities in recent years [31][32][33]. Figure 1 shows the important use cases from the report, and indicates Connected Public Transport as number one in the Mobility and Transport category. The main aim of initiatives in this area is to reduce traffic and increase the efficiency of public transport. Better integration of public transport (buses, trains, metro, etc.) with the city infrastructure increases their attractiveness for residents, and thus may reduce the share of private transport.
Energies 2021, 14, x FOR PEER REVIEW 3 of 18 making their city a better place to live. Thanks to the close cooperation of residents and city officials, it is possible to shape their city in a more citizen-oriented way [29,30]. In 2020, IoT analysts created the Smart City Use Cases & Technology Adoption Report based on 50 cities around the world and their needs. The report shows the important matters dealt with by city authorities, with many of the cities still in the Smart City 1.0 and 2.0 phase. Research results indicate that categories related to mobility and transport are the most important issues that have been addressed by smart cities in recent years [31][32][33]. Figure 1 shows the important use cases from the report, and indicates Connected Public Transport as number one in the Mobility and Transport category. The main aim of initiatives in this area is to reduce traffic and increase the efficiency of public transport. Better integration of public transport (buses, trains, metro, etc.) with the city infrastructure increases their attractiveness for residents, and thus may reduce the share of private transport. The second use case identified in the report, no less important than public transport, is Traffic Monitoring and Management. In this area, it is necessary to adapt new solutions for traffic [34], taking into account its increasing level, time-dependent intensity, and new rules and regulations regarding restricted areas, vehicles with various types of propulsion, and others [35,36].
Hence, the aim of changes to the urban infrastructure is to monitor the number of vehicles on the roads and to avoid city closure due to poor traffic management. By collecting large amounts of data from multiple sensors and cameras across the city, one can manage the traffic and respond much faster to emergencies [37,38]. The availability of this data allows the development of new algorithms and solutions to such tasks as reducing or eliminating traffic jams. Thanks to modern technologies in the Internet of Things (IoT), such as the high-performance cellular communication networks or advanced machine learning-based prediction algorithms, cities can take advantage of the new opportunities to become more citizen-friendly [39,40].

54%
The Top 10 Smart City use cases The second use case identified in the report, no less important than public transport, is Traffic Monitoring and Management. In this area, it is necessary to adapt new solutions for traffic [34], taking into account its increasing level, time-dependent intensity, and new rules and regulations regarding restricted areas, vehicles with various types of propulsion, and others [35,36].
Hence, the aim of changes to the urban infrastructure is to monitor the number of vehicles on the roads and to avoid city closure due to poor traffic management. By collecting large amounts of data from multiple sensors and cameras across the city, one can manage the traffic and respond much faster to emergencies [37,38]. The availability of this data allows the development of new algorithms and solutions to such tasks as reducing or eliminating traffic jams. Thanks to modern technologies in the Internet of Things (IoT), such as the high-performance cellular communication networks or advanced machine learning-based prediction algorithms, cities can take advantage of the new opportunities to become more citizen-friendly [39,40].

Usage of 5G Network
The 5th generation network is becoming more and more popular thanks to its high connection speed, ability to handle large amounts of data, and low latency. The possibilities of its application in the area of smart cities and the IoT make the 5G network an important element of modern technical solutions [41,42]. The use of the 5G network can cover wide areas of communication, ranging from a simple connection with sensors in the city infrastructure, to complex data exchange with an advanced city management system [43][44][45]. Improving collaboration in various areas through effective communication can contribute to the development of highly accurate, environmentally friendly, and cost-effective logistics, making the related traffic more efficient. This may include the exchange of information between wholesalers and distributors or manufacturers. For example, factories can capture data related to their production, such as the availability of resources, the amount of products expected to be delivered, or the amount of available space in a distribution warehouse, which fits well with the Industry 4.0 concept [46][47][48]. Thanks to the efficient communication, multiple devices can communicate with each other, with a higher-level management system or with the cloud, but also process data within process controllers, which is in line with the Edge Computing concept [49]. As shown in [50], Machine-to-Machine (M2M) communication and the surrounding infrastructure in Intelligent Transport Systems (ITS) play an important role in solving problems, such as road congestion, road accidents, and high fuel consumption of vehicles.
The urban infrastructure related to traffic that uses the 5G communication together with the RFID technique is presented in Figure 2. In the central part, there is a city traffic management center with visualization stations for operators and a mobile application for citizens. Data sources, including moving vehicles, RFID readers in road infrastructure, special purpose vehicles, and more, are located in the surrounding circle. 5G infrastructure connects objects from the central and external parts of Figure 2.
The 5th generation network is becoming more and more popular thanks to its high connection speed, ability to handle large amounts of data, and low latency. The possibilities of its application in the area of smart cities and the IoT make the 5G network an important element of modern technical solutions [41,42]. The use of the 5G network can cover wide areas of communication, ranging from a simple connection with sensors in the city infrastructure, to complex data exchange with an advanced city management system [43][44][45]. Improving collaboration in various areas through effective communication can contribute to the development of highly accurate, environmentally friendly, and cost-effective logistics, making the related traffic more efficient. This may include the exchange of information between wholesalers and distributors or manufacturers. For example, factories can capture data related to their production, such as the availability of resources, the amount of products expected to be delivered, or the amount of available space in a distribution warehouse, which fits well with the Industry 4.0 concept [46][47][48]. Thanks to the efficient communication, multiple devices can communicate with each other, with a higher-level management system or with the cloud, but also process data within process controllers, which is in line with the Edge Computing concept [49]. As shown in [50], Machine-to-Machine (M2M) communication and the surrounding infrastructure in Intelligent Transport Systems (ITS) play an important role in solving problems, such as road congestion, road accidents, and high fuel consumption of vehicles.
The urban infrastructure related to traffic that uses the 5G communication together with the RFID technique is presented in Figure 2. In the central part, there is a city traffic management center with visualization stations for operators and a mobile application for citizens. Data sources, including moving vehicles, RFID readers in road infrastructure, special purpose vehicles, and more, are located in the surrounding circle. 5G infrastructure connects objects from the central and external parts of Figure 2.  The basic functionality of the 5G network is based on the Radio Access Network (RAN) and Core Network [51]. RAN is represented as a small cell. It consists of devices, communication masts, and small cell towers that exchange data between connected devices. An RAN can have many small towers within its own cells being a bridge between the Internet and the device. The 5G network uses dedicated communication algorithms depending on the type of device. Data exchange between mobile vehicles (e.g., cars, trains, buses) and the 5G small cell is established using ultra-reliable low-latency communication (U-RLLC), with a latency of 1ms. Due to the use of processes with increased safety requirements (autonomous driving, medical procedures), it is important that the connection is durable and reliable. Fixed devices use massive Machine-type Communication (mMTC) communi- cation, which utilizes MIMO algorithms to exchange data between up to 100 devices and a small 5G network tower.
In the development of the 5G network, the centimeter and millimeter wave spectrum (3-300 GHz) is mostly used [51]. This helps to achieve higher throughput with data rates of up to several gigabits per second (Gbps) [52,53]. Another reason for choosing higher frequencies is that lower frequencies are already used in popular wireless networks, such as: Wi-Fi, Bluetooth, Industrial, Scientific and Medical (ISM), and GSM up to 4G, while higher frequencies are still rarely used today. However, the focus on higher frequencies has also created some challenges for 5G technology, one of which is frequency propagation in free space [54]. Unlike low-frequency signals, millimeter waves only propagate a few kilometers and cannot penetrate dense materials, such as building walls, which results in a smaller coverage area. Some studies indicate, however, that these millimeter wave properties can also be an advantage [55,56]. The high attenuation of a given frequency wave makes it possible to reuse that frequency by small cell base stations called picocells and femtocells in a given area. This in turn increases the availability of services to more users in the area [57,58].

Traffic Management Issues
There are different algorithms and solutions for traffic management systems architecture [59][60][61]. Most of them use video cameras attached to masts or traffic light poles to analyze the traffic [36,62]. The main task of the mast-mounted camera is to allow live monitoring of the road area by displaying an image of the street. This gives operators the ability to react to emergency situations, for example, by manual remote control of traffic lights. Based on the camera image, traffic management systems estimate how many cars are in the field of view. In this way, the traffic volume at a certain time of day is determined. On this basis, the duration of red and green lights is determined in order to reduce congestion on individual lanes and to increase the fluency of traffic. A lane with more traffic has higher priority and the time of the green light is extended. Consequently, more vehicles can travel on roads with high loads, which makes traffic smoother [63][64][65][66].
While video analytics works for the most part [67], it also has its downsides. Depending on the configuration of the camera, it usually has a range from a few meters to about several hundred meters. This makes it difficult to predict changes in traffic resulting from events outside the field of view of the camera. Furthermore, while this solution is good for low-density urban regions, creating a reliable camera-based traffic management system for areas with lots of roads is a challenge due to the heavy load on intersections and the distribution of adjacent buildings.
For these reasons, hybrid solutions are sought that use supplementary data to determine traffic situations. For example, the traffic management system in Rzeszów, Subcarpathia, PL uses data collected by municipal public transport vehicles. City buses are equipped with sensors that recognize traffic at major intersections within the city and are connected to the mobile network via city masts. Due to the higher priority of public transport over private vehicles, the buses have more time at intersections to cross them. If traffic is greater than normal (e.g., during rush hour) and the travel time to a bus stop may be longer than planned, the traffic light algorithm extends the green light time for a specific lane to allow the bus to run.
An example of a crossing of a one-way street with a dual carriageway is shown in Figure 3. The one-way road contains three directional lanes with two lanes straight ahead and another one for the left turn. This solution may cause traffic jams at rush hour, especially if the intersecting streets lead to and from the city. For example, it creates a scenario where the lanes in one direction are less loaded but still have the same amount of green light as the lanes with a greater load. In the situation illustrated in Figure 3 and another one for the left turn. This solution may cause traffic jams at rush hour, especially if the intersecting streets lead to and from the city. For example, it creates a scenario where the lanes in one direction are less loaded but still have the same amount of green light as the lanes with a greater load. In the situation illustrated in Figure 3, most of the vehicles in the left lane are preparing to turn left at the nearest intersection. As it is only a short lane and there are many vehicles, the green light time may not be enough to keep the intersection from jamming.  To help overcome problems related to traffic control, the traffic management system can obtain advance information about the road the driver will be driving. The image analysis does not provide this information. The system will only detect the increased number of vehicles, but the algorithm will have no heading-related information; hence, it is not possible to properly manage the extra green light time in the lane. Moreover, the limited range of the camera can correctly identify only some of the vehicles approaching the intersection, and if there is a large vehicle (bus, truck) waiting in the lane, it obscures the view of other vehicles behind it.

RFID Application for Traffic Management
Due to the limitations of video technology, we propose here a new concept using the Radio Frequency IDentification known as RFID [68,69]. It seems relatively easy to use and inexpensive, and the data collected from RFID transponders does not have to be subjected to demanding image recognition algorithms [70,71]. The use of RFID makes it possible to obtain accurate information not only about how many vehicles are driving in a given lane, but also which vehicle we are dealing with [72]. Thanks to this knowledge, the system can determine the lanes that are used more often than others and adjust traffic lights or the direction of lanes to minimize traffic load. In the case of bus lanes, it will give the possibility of using them for private vehicles if possible, and in the case of emergency vehicles, it will give them a clear path [73][74][75].
The operation of the proposed system will be presented using Figure 4 divided into parts (a-d), where vehicles drive forward in two or three lanes. The vehicles have RFID transponders embedded during production or mounted as stickers. RFID readers are installed inside the road infrastructure and connected to the device collecting the RFID data from vehicles on each lane (Figure 4a). RFID transponders contain all the important data related not only to the vehicle characteristics, but also to information on how the driver should drive to reach the destination from the starting point. The solution assumes that vehicle-to-infrastructure (V2I) communication takes place via 5G. The collector device forwards the data acquired from the RFID readers to the traffic management center via the nearest 5G cell tower (Figure 4b). The system analyzes traffic data in real time and forecasts the traffic volume at the nearest intersections. Consequently, the system is able to manage the change of traffic lights depending on how many vehicles are in a certain lane. The driver receives feedback from the city management control system via an on-board equipment inside the vehicle, such as a navigation or driving assistant (Figure 4c), which signals the established traffic arrangement (Figure 4d).

Intersection Control Model
The Potts and Ising models were adopted to determine the current status of the traffic

Intersection Control Model
The Potts and Ising models were adopted to determine the current status of the traffic lights at the intersection. The Potts model is an extension of the Ising model derived from statistical physics theory [13,15]. Both models refer to processes occurring in the structures of complex systems. However, the Potts model, unlike the Ising model, allows more than two states to be considered. Taking into account the scope of the issue discussed in the paper, both models were used.
These models use an expression describing the energy of any state, which is given by the Hamiltonian of the system: where s i is the state of the i-th node, and J is the coupling constant between nodes v i and v j . This is a simplified version as, unlike the magnetism models, no external magnetic field is required in the case under consideration. In the original model, all nodes have the same role in the system and interact equally depending on their current state. Taking into account the characteristics of the traffic light control system, it was necessary to develop a new solution. Therefore, two sets of nodes V l and V c were introduced. V l = {v l i ; ∀i = 1, 2, 3, · · ·} denotes the set of all nodes corresponding to individual traffic lights in specific carriageway lanes, while V c = {v c j ; ∀j = 1, 2, 3, · · ·} denotes the set of all nodes corresponding to cars on the carriageway before the lights.
In the adopted model, it is possible to define a wider set of available states. Let us denote this set as S = {s 1 , s 2 , . . . , s q } and it is a finite set, where q ∈ Z.
However, given the characteristics of a road intersection and the different nature of traffic lights and cars, subsets of states independent of each other must be defined, in contrast to the classical model.
Thus, the set of states for traffic lights is S l i ⊂ S and the set of states for vehicles is S c ⊂ S. Moreover, independent subsets must be determined for each of the lights in the lanes concerned: V lc i = {v lc j ; ∀j = 1, 2, 3, · · ·}. These subsets will contain all potential vehicles whose state corresponds to the states acceptable for a given v l i . Each such subset will be a dynamic set, i.e., its contents will change depending on the current state before the intersection.
At this point, based on expression (1), we define: where δ s i s j is the Kronecker delta, which equals one whenever s i = s j and zero otherwise. Under the assumptions made, the constant J = 1. In the future, solutions can be developed to vary the interaction between nodes (lights) by different values or expressions of J. Assuming two independent states s 1 and s 2 for the Ising model, and the probability of their occurrence as p(s 1 ) = e βH 1 , and p(s 2 ) = e βH 2 , the relative probability that the system is in two states is: where β = 1/kT denotes the parameter defined by the absolute temperature T and the Boltzmann constant k, and H 1 is the Hamiltonian of state s 1 , and H 2 is the Hamiltonian of state s 2 .
As the system under consideration is temperature independent, we assume that if p ≥ 1, then the node changes state from s 1 to s 2 ; otherwise, the node remains in state s 1 .
Assuming an Ising model for the case of traffic lights that can indicate two directions of travel, e.g., left and straight or right and straight, we can define the following states for the individual nodes corresponding to the lights: The basic state refers to the basic direction of travel for a lane, e.g., left or right. The alternative state refers to the situation where a turn is possible as well as straight ahead is allowed. This allows us to generalize the model for both types of turns.
However, in the case of lights corresponding to straight ahead taking into account the alternative right or left turn, an extension of the Ising model in the form of the Potts model must already be adopted and the following 3 states: when the node is in its basic state (straight ahead) s 2 when the junction is in an alternate state (driving straight and left) s 3 when the junction is in an alternate state (driving straight and right) . (5) Therefore, taking into account the above assumptions, the dependencies δ s i s j should be defined. For both the Ising and Potts models, if s l i denotes the state of a given node corresponding to a specific traffic light for a given traf-fic lane, and s j i c j denotes the states related to the set of vehicles affecting the state of a given traffic light, then δ s l i s j i c j is defined as: When two states are compared, or actually the current state then s l i with the states of vehicles s j i c j , then δ will be equal to 1 if both states are the same. Otherwise, δ equals 0. For example, if the current traffic light indicates a left turn direction δ will be equal to 1 if the vehicle in question also wants to go left, while δ will be equal to 0 if the vehicle in question also wants to go straight. Of course, the same principle applies to all other combinations.

Simulation and Results
To illustrate the principle of the adopted model, simulations were carried out with the use of real traffic data obtained on the basis of drone observations of vehicle flow at several intersections in Rzeszów, PL ( Figure 5). Two intersections will be considered here: the first with three lanes and the second with two lanes but with uphill traffic.
The first intersection consists of three direction lanes, which by default have the option of turning left, driving straight, and turning right. However, it is assumed, that the lanes may allow vehicles to additionally turn left (L) or right (R) and drive straight (S) ahead in a flexible manner depending on the current needs ( Figure 6). Such an approach allows for taking into account various acceptable variants on the basis of the model described in Section 6.
The basic assumption of the simulations was to distinguish two phases, i.e., in one phase, vehicles could leave the intersection (Go phase) and in the other, they could not (Stop phase). On the other hand, in both phases, vehicles could appear with different frequencies for different directions of travel.
Each of the phases was divided into iterations. Six iterations were distinguished for the Stop phase and two iterations for the Go phase. Table 1  question also wants to go straight. Of course, the same principle applies to all other combinations.

Simulation and Results
To illustrate the principle of the adopted model, simulations were carried out with the use of real traffic data obtained on the basis of drone observations of vehicle flow at several intersections in Rzeszów, PL ( Figure 5). Two intersections will be considered here: the first with three lanes and the second with two lanes but with uphill traffic. The first intersection consists of three direction lanes, which by default have the option of turning left, driving straight, and turning right. However, it is assumed, that the lanes may allow vehicles to additionally turn left (L) or right (R) and drive straight (S) ahead in a flexible manner depending on the current needs ( Figure 6). Such an approach allows for taking into account various acceptable variants on the basis of the model described in Section 6. The basic assumption of the simulations was to distinguish two phases, i.e., in one phase, vehicles could leave the intersection (Go phase) and in the other, they could not (Stop phase). On the other hand, in both phases, vehicles could appear with different frequencies for different directions of travel.         Of course, the individual values are also influenced by the current phase. As can be seen in Figure 7, the simulation presented here considers different situations corresponding to changing numbers of vehicles for left, straight, and right directions of driving. Consequently, different driving directions gained numerical advantage at different stages of the simulation. Figure 8 shows changes in the states of individual lanes. For the stability of the system operation, it was assumed that the actual change of the state of individual lights for the Go phase is based on the last state in the Stop phase, i.e., on the current state at the moment of transition between phases.
The second case under investigation is an intersection with two lanes that may allow straight-ahead and right-turn respectively shown in Figure 9a. In this case, each of the individual lanes can be in two states: basic and alternative, while for each lane, these states are different, i.e., for the first one, the basic state is driving straight ahead (S), and for the second, to the right (R). The alternate state for both lanes is driving straight ahead and right (SR). Due to the fact that the simulation corresponded to a real intersection with only one cross road on the right, the same number of iterations of four for the Stop phase and the Go phase was taken into account. Additionally, the actual intersection is located on a slight elevation, which means that the number of cars leaving the intersection in each iteration of the Go phase is smaller than for the intersection shown in Figure 6.
Two variants were carried out for this intersection, assuming the same input data, i.e., the initial number of vehicles at the intersection and the number of vehicles with the declared driving direction arriving at the intersection in individual iterations. Option I allows driving straight and turning right from both lanes, of course with protection eliminating a potential collision. In option II, it was assumed that vehicles from the left lane can go straight, and the possibility of changing the direction of travel, i.e., right or straight-right, is available on the right lane.
Comparing the obtained results (Figure 9b,d), it can be seen that the first option has a greater ability to adapt to changing conditions and it quickly unloads the number of vehicles at the intersection for both traffic directions. Changes in the states of the individual lights (Figure 9c,d) confirm this adaptability of the system.
Compared to the actual traffic measurements for lanes with fixed directions in Rzeszów, the simulation shows an increase in the smooth flow of vehicles up to 20-30%. It should be noted that the whole course of changes in the states of individual lights can be used in the future as input data for systems for prediction of their state also taking into account a wider set of historical data. However, at the moment, this aspect was not included in the area of conducted research.
are different, i.e., for the first one, the basic state is driving straight ahead (S), and for the second, to the right (R). The alternate state for both lanes is driving straight ahead and right (SR). Due to the fact that the simulation corresponded to a real intersection with only one cross road on the right, the same number of iterations of four for the Stop phase and the Go phase was taken into account. Additionally, the actual intersection is located on a slight elevation, which means that the number of cars leaving the intersection in each iteration of the Go phase is smaller than for the intersection shown in Figure 6. Two variants were carried out for this intersection, assuming the same input data, i.e., the initial number of vehicles at the intersection and the number of vehicles with the declared driving direction arriving at the intersection in individual iterations. Option I allows driving straight and turning right from both lanes, of course with protection elim-

Conclusions
The traffic control system described here integrates technical solutions in the field of RFID and 5G, thus avoiding the disadvantages of video recognition and enabling fast real-time communication. The flows of vehicles in individual lanes may be analyzed by appropriate algorithms, which allow flexible setting of traffic lights and minimize congestion. The proposed algorithms are based on the Potts and Ising models derived from the theory of statistical physics; however, the simulation results presented in the paper show that they are also suitable for traffic analysis applications. In addition, the model adopted by the authors takes into account the interaction between vehicles and lights.
As a result, it can be expected not only to increase the comfort of traveling for drivers and passengers or to improve urban logistics, but also to reduce the impact of traffic on environmental factors, including a reduction of fuel consumption and air pollution.