Intelligent Traffic Light Time Cycle Simulation Model using Fuzzy Mamdani

: The growth of motorized vehicles in Indonesia has increased significantly. According to data from the Central Bureau of Statistics, the number of motorized vehicles in Indonesia has increased by around 10% each year in the last five years. One of the negative impacts of the increasing number of motorized vehicles is traffic congestion. Traffic congestion has become a severe problem in several cities in Indonesia. One of the causes is the increase in the number of vehicles at road intersections, which impacts congestion and the safety of road users. The rapid growth in the number of vehicles requires a more comprehensive strategy to reduce congestion and accidents at road intersections. Therefore, an intelligent transportation system is critical, especially in the time-cycle configuration of intelligent red lights. The research was conducted at the Banyumas-Sokaraja-Purbalingga provincial road section in Central Java, Indonesia. This research aimed to model the time-cycle of the red light using the Mamdani fuzzy inference system to simulate the green light time configuration to reduce the waiting time of road users at highway intersections. The simulation results showed that the time-cycle configuration and green light time length of the fuzzy Mamdani calculation were more varied relative to the number of vehicles. The values were relatively smaller than 6 to 54 seconds from the time configuration set by the local Department of Transportation. This shows a time efficiency for road users of up to 27%, which means that road users can complete trips 6 to 13 seconds faster


Introduction
Motorized vehicle growth in Indonesia has seen a significant uptick in the past decade.According to data from BPS-Statistics Indonesia (BPS), the number of motorized vehicles in Indonesia has increased by approximately 10% annually over the last five years [1].Key drivers of this growth include economic expansion, urbanization, and an uptick in purchasing power [2].However, this rapid surge has come with drawbacks, notably heightened traffic congestion, particularly in major cities like Jakarta [3].Moreover, the surge in vehicle numbers contributes to an increase in greenhouse gas emissions, a major contributor to global climate change [4].In 2022, data from the Directorate General of Land Transportation indicated a 12% increase in two-wheeled vehicles and an 8% increase in fourwheeled vehicles compared to the previous year [5].Two-wheeled vehicles still dominate the motorized vehicle market in Indonesia, constituting around 75% of the total registered vehicles [6].Factors fueling this motorized vehicle growth include more affordable pricing, flexible scheduling, credit programs, and the implementation of sales tax on luxury goods (PPnBM) incentives [7].
The issue of rising vehicle ownership and associated congestion is not unique to Indonesia.It affects both developing and developed economies, with critical congestion areas being a common feature in urban regions [8].In Kuala Lumpur, Malaysia, rapid urbanization and population growth have intensified traffic congestion, leading to delays and financial losses for residents [9].Similarly, in Beijing China, the rapid increase in private car ownership and usage in large cities has led to severe traffic congestion, air pollution, and high carbon emissions [10].These examples highlight the broader global challenge of managing the increasing number of vehicles and their impact on urban environments.
The province of West Java exhibits the highest growth in motorized vehicles, attributed to urbanization and industrial expansion [11].Meanwhile, Central Java and East Java provinces maintain steady growth, particularly in major cities such as Semarang, Surabaya, and Malang [12].The increase in the number of motorized vehicles often correlates with the rate of traffic accidents [13].According to data from the Indonesian National Police Traffic Data Center (Pusiknas Polri), there were 57,117 traffic accidents recorded from January 1 to June 15, 2022.The majority of accidents occurred in areas with well-maintained roads, constituting 93.45% of the total incidents [14].Driver behavior, such as high-speed driving, non-compliance with traffic signs, and mobile phone use while driving, contributes to the high incidence of accidents [15].The rapid growth of vehicles necessitates a more comprehensive strategy to reduce road accident risks.Hence, the need for Intelligent Transportation Systems [16], particularly smart traffic lights, becomes increasingly urgent.Smart traffic lights can adjust green or red light durations based on real-time traffic density, reducing congestion and the potential for collisions at intersections [16].
The research [17] conducted simulations on smart traffic lights utilizing a multi-agent cellular automation (CA) model.The simulation results showed that the CA timer method for traffic lights could alleviate congestion twice as fast as conventional methods.Another study [18] focused on optimizing traffic light timings using a genetic algorithm implemented through 500 iterations.The simulation outcomes demonstrated that adjusting the number of vehicles present could reduce the configuration time of traffic lights by up to 40 seconds.In a separate investigation [19], smart traffic lights were proposed using the fuzzy inference system (FIS) with dynamic round-robin scheduling.Results showed a 65.35% improvement compared to regular waiting times.Another research endeavor [20] introduced a smart traffic light management simulation that integrated social media information and sensor data.The model, constructed using Mamdani FIS, indicated that smart traffic lights could adapt their signals based on road density, vehicle speed, and distance.In a related study [21], smart traffic lights were simulated using Mamdani FIS based on primary traffic conditions in West Jakarta.Simulation results demonstrated a time efficiency improvement ranging between 23-47%.Based on these literature findings, fuzzy Mamdani emerges as the state-of-the-art method for modeling smart traffic lights.
This paper employs the fuzzy Mamdani method to simulate smart traffic lights, explicitly focusing on the number of motorized vehicles on the Sokaraja-Purbalingga road section, observed directly as a case study.Workers and schoolchildren frequently use this road section, a common site of accidents [22].Therefore, the main contribution of this article is modeling intelligent traffic lights using fuzzy Mamdani with raw datasets obtained from firsthand observations of the Sokaraja-Purbalingga provincial route.
The remainder of this paper is structured as follows: section 2 delves into the research methodology employed in the study outlines the specific steps and procedures used to conduct the research and then presents the research findings and results in detail.Section 3 builds upon the results, and followed by the comprehensive discussion and analysis in section 4. Subsequently, section 5 summarizes the key conclusions drawn from the research.

Research Method
This section discusses the primary data on the number of vehicles, membership functions, and defuzzification.https://ejournal.ittelkom-pwt.ac.id/index.php/infotel

Primary Data on the Number of Vehicles
We conducted direct observations on the Banyumas-Sokaraja-Purbalingga provincial road section to collect primary data on the number of vehicles.Along this road section, we observed and recorded the vehicle count at each road traffic control device (APILL) or traffic light.
Figure 1 depicts four points of APILL that we observed regarding their time cycles and vehicle counts.Figure 1 (section 4) illustrates the APILL along the road from the direction of Purbalingga, Figure 1 (section 3) shows the APILL along the road from the direction of Imam Bonjol Street, Figure 1 (section 1) represents the APILL along the Banjarnegara-Purwokerto highway, while Figure 1 (b) displays the APILL along the road from the direction of HokTekBio Sokaraja.
Table 1 presents the results of observations and recordings of the number of vehicles during one cycle conducted within the time range of 06:00-07:30, considering the peaktime morning traffic from various road users such as schoolchildren, office workers, and traders.During this time duration, vehicle counts were measured for a total of five cycles.The term 'net flows' in Table 1 refers to the quantity of four-wheeled vehicles, while 'gross flows' encompass the total number of vehicles.The values for 'red' and 'green' times signify the duration in seconds for both traffic lights, and the 'total time-cycle' is derived by summing the 'red' and 'green' times, with an additional 3 seconds allocated for the yellow light.The variable 'n_cycle' represents the ratio of the total time-cycle within a one-hour period.

Membership Functions
Table 2 outlines the four road sections' membership functions (MF).Each road section within these MFs is categorized into three groups: short, medium, and long, representing the number of vehicles or their density levels.These three MF categories share the same value range for the sake of simplification while still adhering to the proposed model [21].The MF table is visually represented in Figure 2. The fuzzy concept enables the representation of a value in two categories simultaneously.For example, referring to Figure 2, if data is indicating a vehicle count of 30, the assigned vehicle count categories are (1) short and (2) medium and their respective membership function values are then calculated based on (1) and (2).
Eq. ( 1) provides the formula for calculating the membership function coefficient (µ) corresponding to the input data of the number of vehicles in the short category (vehicle  as illustrated in Table 2. (1) (2) x ≥ 80 (3) https://ejournal.ittelkom-pwt.ac.id/index.php/infotelTable 3 to Table 5 each present fuzzy rules for the time-cycle defuzzification process used in the time configuration of smart traffic lights.Each road section has a different time-cycle setting depending on the vehicle count conditions on other road sections.For example, if the number of vehicles on road section-1 = short and road section-2 = medium, the time cycle on road section-4 will be set to quick.However, if the number of vehicles on road section-1 = medium and road section-2 = long, then the time cycle on road section-4 becomes longer (longer) than before.These fuzzy rules for time-cycle configuration apply to all four road sections.The vehicle count conditions on one road section significantly influence the time cycle on the traffic light of another road section.
Given the information in these three tables, the subsequent step involves evaluating fuzzy rules based on the corresponding output category of the time cycle.For instance, the category 'quick' in the time-cycle is determined through several fuzzy rule evaluations, as outlined below: 1. IF road-section-1 vehicle queue is short AND road-section-2 or 3 vehicle queue is short and road-section-4 vehicle queue is short then time-cycle is Quick 2. IF road-section-1 vehicle queue is short AND road-section-2 or 3 vehicle queue is short and road-section-4 vehicle queue is medium then time-cycle isQuick 3. IF road-section-1 vehicle queue is short AND road-section-2 or 3 vehicle queue is medium and road-section-4 vehicle queue is short then time-cycle is Quick 4. IF road-section-1 vehicle queue is medium AND road-section-2 or 3 vehicle queue is short and road-section-4 vehicle queue is short then time-cycle is Quick In the subsequent step of the fuzzy Mamdani method, the minimum value will be selected from each membership function that produces the same type of time-cycle category.
Here is an example of fuzzy rule number 1, IF road-section-1 vehicle queue is short (0.75) AND road-section-2 or 3 vehicle queue is short (0.4) and road-section-4 vehicle queue is short(0) then time-cycle is Quick=0.Nilai Quick=0 is the result of MIN(0.75, 0.4, 0).Based on these four rule examples, four values of the time-cycle category=quick will be collected.In the final step, the system will select the value MAX [quick(µ, n)].

Defuzzification
The subsequent step in the fuzzy Mamdani method involves defuzzification, wherein the moment value or area under the curve is computed based on all intersection points obtained from MAX[quick(µ, n)] against the membership function of the time cycle, as illustrated in Figure 3.
Figure 3 depicts four intersection points of the time-cycle membership function with the final outcome MAX[quick(µ, n)].Subsequently, each area under the curve, as illustrated in Figure 3, will be computed for (a) the moment and (b) the flat geometric shape area.Based on Figure 3, it can be observed that there are four flat geometric shapes or areas, namely a right-angled triangle (far left), a square, a trapezium, and a rectangle (far right).Table 6 presents the formulas used to calculate the geometric areas of these four shapes.Eq. ( 4) is derived based on the intersection points calculation of the vehicle count membership function against the time-cycle membership function.According to Figure 3, there are five intersection points that yield four geometric shapes, namely the intersection points 125, 138.25, 161.75, 167.98, and 200.Each intersection point generates a curve with upper and lower boundaries calculated using integrals to obtain the moment value [23].For exhttps://ejournal.ittelkom-pwt.ac.id/index.php/infotelample, to calculate the moment value for the first row in (4), this formula can be employed: The final step involved defuzzification based on the calculated values of (a) the moment and (b) the geometric area .In practical terms, the time-cycle represents the total duration of red, green, and yellow traffic lights.The adaptive configuration of green light durations concerning the number of vehicles becomes the core of intelligent traffic lights.
Eq. ( 5) is employed to calculate the flow ratio (Fr).Eq. ( 6) is used for determining the phase ratio (Pr), while ( 7) is utilized to compute the final green light duration (Gr), obtained from the ratio of the moment to the geometric area and the phase ratio value [21].

Result
This paper proposes a model for intelligent traffic lights using fuzzy Mamdani, relying on primary data obtained through direct observations on four provincial road sections in the Banyumas-Purbalingga regency.The ultimate outcome is an adaptive configuration of green light durations in response to the number of vehicles.The duration of the green light is determined by calculating the time cycle based on the moment value and geometric area produced by the membership function graph.

Moment and Geometric
Based on Figure 3 and Table 6, there are four geometric areas obtained from the intersection points of each time-cycle category value traversing the x-axis.The input values are the number of vehicles on the four road sections, resulting in four distinct moment values for each road, as indicated in Table 7. Furthermore, according to Figure 3, there are four geometric areas with the following respective areas: right-angled triangle = 3.5112, square = 12.455, trapezium = 1.8067, and rectangle = 1.601.Table 7 illustrates the model comprising moment values and four geometric areas obtained.It is important to note that the ultimate geometric areas resulting from MAX[quick(µ, n)] vary depending on the conditions of the vehicle count.As seen in Table 7, the upper and lower limits of the integral function correspond to the intersection points of each geometric area.For instance, the Moment 1 value in Table 7 calculates the area under the right-angled triangle with the initial boundary from 125 to 138.25.The moment model presented in Table 7 is derived from the analysis of Figure 3.A preliminary observation of Figure 3 suggests that the square area exhibits the largest curve area among the three other geometric shapes, while the rectangle area appears to have the smallest curve area in comparison.This curve area or geometric area indirectly reflects the number of vehicles present.A higher moment value corresponds to a greater area occupied by vehicles on that specific road section.
Table 8 illustrates the results of moment and geometric area calculations based on five cycles of direct observations conducted within the time window of 06:00-07:30.According to Table 8, only two geometric shapes are formed, namely a square and a trapezium; there are no geometric shapes such as right-angled triangles or cubes (squares) generated.The moment values and geometric areas in Table 8 are heavily influenced by the data of the number of vehicles.A visual representation of the data presented in Table 8 is provided in Figure 4.
Based on Table 8, cycles 1 and 5 exhibit the highest cumulative number of vehicles among the observed cycles.Consequently, these two cycles also possess larger cumulative moment values.However, a unique aspect highlighted by the moment measurements is that despite an increase in the number of vehicles, there is a decrease in the number of membership functions (MF) involved.This can be observed based on the count of geometric shapes in cycles 1 and 5, which is actually lower than in the other cycles because only one MF is engaged, namely µ normal .

Time-Cycle
The moment and geometric area calculations in Table 8 serve as the basis for the defuzzification process of the time-cycle values.As previously explained, the time-cycle refers to the time interval (in seconds) in one full rotation of a traffic control system.An efficient and coordinated time-cycle is crucial for effective traffic management, as it can maximize traffic flow and reduce waiting times for road users.Table 9

Green Light
The previously explained time-cycle in the preceding section can be considered as the sum of the durations of the red light + green light + yellow light.Thus, from the time-cycle value, the duration of the green light can also be determined.Based on (7), the duration of the green light can be calculated by multiplying the time-cycle by the phase ratio.Table 10 presents the calculation results for the flow ratio and phase ratio based on ( 5) and ( 6).In Table 9, as previously indicated, the time-cycle for the first cycle is 164.Consequently, during this initial cycle, the duration of the green light on each road section can be computed using (7).As an illustration GR  An interesting observation is evident in the simulation results for Cycle 4. As previously explained, the data on the number of vehicles were measured within the time range of 06:00-07:30.The simulation results from Figure 6(a) to Figure 6(d) indicate an increasing traffic density approaching 07:30.In more detail, if one cycle takes about 9-10 minutes on each road section, Cycle 4 is expected around 07:15.Indirectly, the simulation results based on this primary data reveal a behavior among the public that prefers mobility during peak hours.By 07:15, a significant number of school children may have already entered their classrooms, but a small portion may still be caught in traffic congestion.Our measurements do have a limitation as they do not capture the categorization of road users based on their professions.
Figure 6(c) illustrates the comparison of green light durations on the third road section, Imam Bonjol Street in Purwokerto, while Figure 6(d) presents the simulation results for the four-way road section from Purbalingga to Purwokerto.In general, the simulation results from both of these figures indicate a consistent trend, namely the presence of time efficiency achievable through the fuzzy Mamdani method.
The simulation outcomes depicted in Figure 6(a) to Figure 6(d) reveal varying durations of green lights.Specifically, Figure 6(a) and Figure 6(c) highlight deficiencies in the static green light durations implemented by the local Transportation Agency (Dishub).The Transportation Agency has set static green light durations of 28 seconds for road section 1 and 35 seconds for road section 3.However, the simulation results indicate that these durations are not effectively adapting to the existing traffic volume at those times.For instance, if the fuzzy Mamdani proposed durations of 34 seconds for road section 1 and 48 seconds for road section 3 were adopted, some road users could potentially complete their journeys 6 and 13 seconds faster, respectively.While a more detailed investigation is required for precise calculations, it is evident that green light durations adjusted relative to the traffic volume offer significant advantages for road users in terms of reduced waiting times.

Discussion
Until now, one of the challenges in road transportation is the phenomenon of traffic congestion, which consistently leads to traffic accidents, pollution, and economic losses [24][25][26][27][28].One effective approach to minimize these issues is through traffic flow management at intersections.Long-term traffic flow at intersections can be controlled using a well-designed traffic light control system [29,30].Additionally, there is the problem of traffic congestion caused by suboptimal signal timing at the intersection of roads [31].Therefore, the signal timing control at an intersection is a crucial aspect of traffic management [32].The FIS has often proven to yield better results than static traffic light control [33].
This research focuses on modeling traffic signal timings through the simulation of the fuzzy Mamdani inference system method.The study provides detailed calculations of the time-cycle, offering a comparative analysis between the time-cycle calculations conducted by the District Transportation Agency (Dishub Kabupaten) and the Mamdani FIS.The results highlight notable differences.The Mamdani FIS's time-cycle calculations reveal a relatively more diverse configuration of timings in response to varying traffic volumes.Cumulative values show a consistent reduction, ranging from 6 to 54 seconds, indicating a notable improvement in waiting time efficiency of up to 27%.Furthermore, the Mamdani FIS identifies a deficiency in green light timings.This deficiency allows some road users to complete their journeys more quickly, with time savings of 6 to 13 seconds.In summary, the FIS, utilizing the Mamdani method, demonstrates its effectiveness in controlling intelligent traffic lights at a complex four-way intersection, showcasing its potential for optimizing traffic flow and reducing waiting times.

Conclusion
The implementation of the Mamdani FIS, incorporating four Membership Functions for traffic volume at a four-way intersection, results in a more varied configuration of timings.The proposed time-cycle values by fuzzy Mamdani consistently fall within the range of 6 to 54 seconds, indicating an efficiency improvement in waiting times of up to 27%.The fuzzy Mamdani method, when simulating the time-cycle, demonstrates a notable reduction https://ejournal.ittelkom-pwt.ac.id/index.php/infotel in waiting times, allowing road users to complete their journeys more quickly, with time savings of 6 to 13 seconds.

Figure 2 :
Figure 2: Membership function graph for the number of vehicles.

Figure 3 :
Figure 3: Intersection points on each time-cycle membership function.
presents the time-cycle values (rounded) for the four observed road sections, compared to the static time-cycle value of 200 seconds set by the local Transportation Agency (Dishub).

Figure 5 Figure 4 :
Figure 4: The visual representation of the data.

Figure 6 (
Figure 6(a) illustrates the comparison of green light duration on the first road section between the fuzzy Mamdani calculation results and the configuration set by the local Transportation Agency, while Figure 6(b) displays the comparison on the second road section.Generally, the fuzzy Mamdani simulation results indicate a shorter waiting time efficiency.This aligns with the actual conditions of traffic on the road, where the green light duration is consistently fixed without considering the varying number of vehicles.An interesting observation is evident in the simulation results for Cycle 4. As previously explained, the data on the number of vehicles were measured within the time range of 06:00-07:30.The simulation results from Figure6(a) to Figure6(d) indicate an increasing traffic density approaching 07:30.In more detail, if one cycle takes about 9-10 minutes on each road section, Cycle 4 is expected around 07:15.Indirectly, the simulation results based on this primary data reveal a behavior among the public that prefers mobility during peak hours.By 07:15, a significant number of school children may have already entered their classrooms, but a small portion may still be caught in traffic congestion.Our measurements do have a limitation as they do not capture the categorization of road users based on their professions.Figure6(c) illustrates the comparison of green light durations on the third road section, Imam Bonjol Street in Purwokerto, while Figure6(d) presents the simulation results for the four-way road section from Purbalingga to Purwokerto.In general, the simulation results

Table 1 :
Primary data on the number of vehicles across four road sections

Table 2 :
Membership functions for the number of vehicles

Table 3 :
Fuzzy role on short time-cycle value

Table 4 :
Fuzzy role on medium time-cycle value

Table 5 :
Fuzzy role on long time-cycle value

Table 7 :
Calculation results for moments

Table 9 :
Preliminary study questions

Table 10 :
Flow and phase ratio