pISSN: 2723 - 6609 e-ISSN: 2745-5254
Vol. 5, No. 10, October 2024 http://jist.publikasiindonesia.id/
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4604
Modeling and Simulation of Vehicle Velocity-Density on Buah
Batu Road Using Decision Tree Regression
Ramadhan Aditya Ibrahim
1
, Putu Harry Gunawan
2
*
Universitas Telkom Bandung, Indonesia
1
2*
*Correspondence
ABSTRACT
Keywords: simulation,
decision tree regression,
velocity-density.
This study aims to explore and simulate the traffic flow
model on Buah Batu Road using the velocity-density
function generated by the Decision Tree Regression method.
The model utilizes a macroscopic approach, specifically the
Lightill, Whitham, and Richards (LWR) model, which
considers vehicle interactions. Observational data were
collected directly from Buah Batu Road and processed to
produce a velocity-density function, which shows that
vehicle speed decreases as density increases, following a
non-linear but step-like pattern. The velocity function
generated by the Decision Tree Regression indicates that for
low density (ρ < 0.102), the average speed is predicted to be
around 3.681 to 4.551, while at high density (ρ > 0.273), the
speed drops to around 1.411 or lower. The simulation was
conducted on a 60-meter road segment with a total
simulation time of 5 minutes and a grid resolution of 300
points. At the beginning of the simulation, a peak density of
0.70 was recorded in the 15-25 meter segment, which then
shifted and decreased to 0.50 in the 30-50 meter segment by
the end. The results indicate that vehicle movement reduces
density and improves traffic flow. Thus, the Decision Tree
Regression method has proven effective in modeling and
simulating the velocity-density relationship to understand
traffic dynamics on Buah Batu Road.
Introduction
Traffic congestion tends to occur in areas with high activity intensity and extensive
land use (Putri & Herison, 2019). Traffic congestion is a common issue in major cities,
including Bandung face (Triwibisono & Aurachman, 2020). Bandung is a significant
center of economic and social activity in Indonesia. However, rapid economic growth and
an increase in the number of vehicles have led to worsening congestion in various parts
of the city. Bandung has approximately 2.2 million vehicles, consisting of 1.7 million
motorcycles and 500 thousand cars (Hakim & Guntur, 2017). This figure is almost
equivalent to the city's population, which reaches 2.4 million people ). This phenomenon
Modeling and Simulation of Vehicle Velocity-Density on Buah Batu Road Using
Decision Tree Regression
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4605
creates serious city mobility and traffic congestion challenges. One area that frequently
experiences congestion is Jalan Buah Batu. Traffic congestion problems tend to occur in
areas with high activity intensity and extensive land use (Prayitno & Wasiwitono, 2016).
Buah Batu Road is approximately 1.70 km long and 13 meters wide. Its strategic
location connects various areas, including toll roads, shopping centers, industrial zones,
and residential areas, making it a primary choice for people to reach frequently visited
places. This results in high traffic volumes on Buah Batu Road, leading to obstacles and
reduced vehicle speeds (Bestari, Selintung, & Salmon, 2023). However, due to its
strategic role, Buah Batu Road also faces significant challenges in ensuring smooth traffic
flow and preventing congestion, which can negatively impact Bandung's mobility and
economy (Putra, 2017).
To illustrate traffic congestion caused by various obstacles that lead to increased
density, refer to Figure 1. In this figure, four motorcycles are considered equivalent to
one vehicle, and trucks are shown as the largest obstacles. Vehicles are categorized into
two types: large vehicles and small vehicles. Large vehicles include trucks and buses with
a length of more than 5 meters and a width of more than 2.5 meters, while small vehicles
include passenger cars and motorcycles with a length of less than 5 meters and a width of
less than 2.5 meters (Saputri, Nugraha, & Amila, 2014).
Previous research on traffic flow simulation has focused on density and speed but
was less intensive and limited in the variables studied (Gunawan, 2014). This study will
expand the variables using the Upwind Scheme Simulation and the Decision Tree method
based on Mean Squared Error (MSE) to model the relationship between density, speed,
volume, and obstacles on Jalan Buah Batu. The results of this simulation will provide
insights into traffic congestion and help find effective solutions.
Figure 1
Illustration of the observation area
Ramadhan Aditya Ibrahim, Putu Harry Gunawan
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4606
This journal aims to explore and simulate a traffic flow model by approximating
the velocity-density function derived from observational data.
Method
Traffic Flow Model
The macroscopic traffic flow model used in this study is the Lighthill-Whitham-
Richards (LWR) model, which is a fundamental model in traffic flow theory. The LWR
model is based on the principle of vehicle conservation (Gunawan, 2014), which states
that the number of vehicles remains constant within a certain road segment over time.
Fundamentally, traffic flow models apply the principle of mass conservation. In the
context of traffic, this principle indicates that the flow of vehicles entering and leaving an
observation point over a certain period remains stable. This study uses the macroscopic
traffic flow model, specifically the Lighthill-Whitham-Richards (LWR) model, which
describes traffic dynamics through the conservation equation.


󰇛

󰇜

(1)
Modeling and Simulation of Vehicle Velocity-Density on Buah Batu Road Using
Decision Tree Regression
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4607
󰇛
󰇜

and
󰇛

󰇜
󰇛
󰇜
(3)
By incorporating the relationship between velocity and density into the
conservation equation, we obtain the transport equation:


󰇛󰇜


In this study, the velocity function v(ρ) is determined using the decision tree
regression method. This approach is chosen to account for the relationship between
velocity and density. This research aims to model and accurately investigate traffic flow
models using regression analysis.
Mean Squared Error (MSE) dalam Decision Tree Regresion
The system's performance is evaluated using the Mean Squared Error (MSE)
calculation (Aldi, Jondri, & Aditsania, 2018), where the best model is the one with the
lowest MSE value (Kushwah et al., 2022). Mean Squared Error (MSE) is the squared
difference average between the predicted and actual values. In the context of regression
using a decision tree, MSE is used to split the data based on features, in this case, density
(ρ), to predict the target, which is speed. The MSE formula can be written as follows:

󰇛


(5)
Explanation:
is the number of samples in the node
is the actual value of the vehicle's speed

is the predicted value based on the tree split
Upwind Scheme
The Upwind Scheme is a first-order finite difference method used to approximate
solutions for the vehicle density conservation equation. This approach is well-suited for
hyperbolic partial differential equations commonly found in traffic flow models. It is
noted for its simplicity in implementation and computational efficiency, making it a
practical choice for numerical simulations.
Ramadhan Aditya Ibrahim, Putu Harry Gunawan
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4608
Consider a one-dimensional domain [0, L], where L represents the length of the
domain, which is discretized into N points. The following notation is introduced:

, 
 󰇝󰇞
 󰇝󰇞
Where ∆x and ∆t represent the spatial and temporal steps, respectively, the Upwind
Scheme can be formulated as follows:



󰇛
󰇛

󰇜
󰇛

󰇜
(6)
Where
is the traffic density at position dan time  󰇛
󰇛
󰇜
󰇜 and
 
󰇛
󰇛
󰇜
󰇜
are the positive and negative components of the velocity function,
which ensure that the method accounts for the flow direction. Finally, the procedure for
solving the transport equation using the Upwind Scheme is detailed in Algorithm 1:
ALGORITHM 1 : PROSEDURE FOR COMPUTING THE UPWIND SCHEME
1
Procedure Upwind FD(F (X), N , L, T , ∆T)
2
Start
3
Define
X
=
L/N
4
Initialize Density: Set Initial Traffic Density Ρ(X, 0)
5
Calculate Velocity
6
Determine The Density At The Next Time Step Using (6)
7
Update Traffic Density
8
Repeat Steps 6-7 Until Final Time T Is Reached
9
End Prosedure
Dataset
In this study, the dataset was created on Buah Batu Road, with an observation length
of 18 meters in one direction. Data was collected over several days at different and
random times by recording traffic conditions in video format. After the data was obtained,
preprocessing was carried out by converting the video into numerical data. This data was
then entered into an Excel format for easier documentation and converted into a .csv
format. A sample of the dataset obtained can be seen in Table 1.
Table 1
Sample Dataset of Buah Batu Road
No
T-In
T-Out
∆t
Speed
Density
1
00:29
00:39
10
1.80
0.55
2
00:32
00:55
23
0.78
0.41
3
00:33
00:45
12
1.50
0.48
4
00:36
01:00
24
0.75
0.48
Modeling and Simulation of Vehicle Velocity-Density on Buah Batu Road Using
Decision Tree Regression
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4609
5
00:36
00:48
12
1.50
0.48
500
07:47
07:50
3
6.00
0.03
The primary objective of this data collection is to derive a speed function by
gathering information on traffic density and vehicle speed at the observation site. A total
of 500 data points were collected, detailed in Table 1. The next step involves calculating
the collected data's speed and density functions. The equations used for these calculations
are as follows:



(6)
Results and Discussion
The research began with a survey and direct data collection on Buah Batu Road,
observing vehicle movements over an 18-meter stretch in one direction. Focusing on one
direction, this study provides a detailed analysis of vehicle dynamics on that road
segment. For research purposes, four motorcycles were considered equivalent to one car.
Data was collected over several days at different and random times, using a camera
mounted on a tripod to record traffic conditions in video format. Once the data was
collected, it was preprocessed by converting the video into numerical data, stored in Excel
format for easier management, and converted into a .csv format. The next stage involved
creating a decision tree model using MSE based on the formula and data obtained. After
the model was created, simulations were conducted to test the model's hypothesis,
evaluate alternative solutions, and visualize the results. The final step was analyzing the
simulation results to understand how these variables influence each other.
Ramadhan Aditya Ibrahim, Putu Harry Gunawan
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4610
Figure 2
Buah Batu Road dataset graph: Speed vs Density
Figure 3
Layout of the observation area
Modeling and Simulation of Vehicle Velocity-Density on Buah Batu Road Using
Decision Tree Regression
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4611
Figure 4
Actual conditions in the observation area
Figure 2 shows the results of the dataset that has been obtained, while Figure 3
presents the layout and actual conditions of the observed area. The purpose of this
observational data collection is to determine the velocity function. This is achieved by
gathering detailed information, including the average velocity and vehicle density passing
through the observation area. This function is represented in equations (6) and (7). The
velocity function results can be obtained using a Decision Tree based on Mean Squared
Error (MSE), as shown in Figure 5. The velocity function in the figure is derived from
the Decision Tree.
Figure 4
Decision tree visualization: speed vs density
Ramadhan Aditya Ibrahim, Putu Harry Gunawan
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4612
The parameters in this graph indicate that traffic velocity tends to decrease as
vehicle density increases. However, in this Decision Tree model, the decrease is not
entirely linear but stepwise. The negative slope of the prediction line suggests an inverse
relationship between velocity and density. This graph provides a fairly accurate
representation of the observational data, and these results can be used as a basis for further
numerical simulations, where the velocity function generated from this model will be
applied.
Figure 5
Visualization of decision tree model results
The decision tree visualized in the figure illustrates how vehicle velocity is
influenced by traffic density. The data is split at each node based on a specific density
value, and the average velocity is predicted for each density interval. For example, if the
density is lower than 0.102, the average velocity tends to be higher, reaching around 3.681
or even 4.551 if the density is very low. Conversely, as the density increases to more than
0.273, the average velocity drops to around 1.411 or even lower to 1.064 if the density
increases. This decision tree represents a nonlinear relationship between density and
velocity, where an increase in density generally results in a decrease in vehicle velocity.
The model simplifies velocity predictions based on density intervals, providing insights
into the impact of traffic density on velocity effectively.
Modeling and Simulation of Vehicle Velocity-Density on Buah Batu Road Using
Decision Tree Regression
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4613
Figure 6
Traffic flow simulation with the upwind scheme
At the initial stage of the simulation (t = 0.00 minutes), conducted along a 60-meter
road (L) with a spatial grid of 300 points (nx), the highest vehicle density was recorded
in the road segment between 15 and 25 meters, with a peak density reaching
approximately 0.70. With a total simulation time set to 5 minutes and time parameters Δt
= 0.001 and Δx = L/nx = 0.2, this simulation shows a significant accumulation of vehicles
in that segment, reflecting the onset of heavy congestion. At this point, vehicles appear
stationary or moving very slowly, resulting in a high-density concentration within a
relatively narrow area. This initial condition illustrates a situation where traffic flow is
significantly obstructed, likely due to road narrowing or other bottlenecks.
As time progresses, the simulation shows that at t = 1.25 minutes, the peak density
shifts to the right, around 20 to 30 meters from the starting point, indicating that vehicles
are beginning to move forward, although congestion persists in that road segment. By t =
2.50 minutes, the density continues to shift further to the right, reaching around 25 to 35
meters, with a slight decrease in maximum density to 0.60. This suggests that traffic flow
is starting to smooth out, and vehicles are spreading out along the road. At the end of the
simulation (t = 5.00 minutes), the peak density has shifted to the segment between 30 and
50 meters, and the maximum density has dropped significantly to around 0.50, indicating
that congestion has been greatly reduced. With the parameters used, this simulation
clearly illustrates how vehicle density changes and decreases over time, reflecting
increasingly smoother vehicle movement and significantly reducing congestion on Buah
Batu Road.
Ramadhan Aditya Ibrahim, Putu Harry Gunawan
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4614
Conclusion
The conclusion of this study indicates that the Decision Tree Regression method
effectively models the relationship between vehicle velocity and traffic density (ρ) on
Buah Batu Road. The velocity function generated by this decision tree shows that vehicle
velocity decreases as density increases, with the decrease being non-linear but stepwise.
This model predicts average velocity based on density intervals, with higher velocity
predictions, around 3.681 to 4.551, for low density (ρ < 0.102) and a decrease in velocity
to around 1.411 or lower at high density > 0.273). The simulation also demonstrated
the shift and reduction in vehicle density over time, indicating improved traffic flow as
time progresses.
Although this model is simple and effective in understanding traffic dynamics on
Buah Batu Road, further research is needed to explore non-linear models or more
complex machine learning techniques to capture more intricate traffic dynamics.
Additionally, integrating real-time traffic data and adaptive signal control systems is
recommended to enhance the accuracy and applicability of this model. Expanding the
model to consider variations in driver behavior, road conditions, and weather factors
could also provide deeper insights into traffic patterns in busy urban areas.
Modeling and Simulation of Vehicle Velocity-Density on Buah Batu Road Using
Decision Tree Regression
Indonesian Journal of Social Technology, Vol. 5, No. 10, October 2024 4615
Bibliography
Aldi, Muhammad Wildan Putra, Jondri, Jondri, & Aditsania, Annisa. (2018). Analisis dan
Implementasi Long Short Term Memory Neural Network untuk Prediksi Harga
Bitcoin. EProceedings of Engineering, 5(2).
Bestari, Sufiati, Selintung, Mary, & Salmon, All Exis Vernando. (2023). Analisis
Pengaruh Berbalik Arah Terhadap Kecepatan Kendaraan Ruas Jalan Poros
Makassar-Maros. Paulus Civil Engineering Journal, 5(4), 637646.
Gunawan, PUTU HARRY. (2014). The conservative upwind scheme for simple traffic
flow model. Prosiding Seminar Nasional Matematika 2014 of Udayana University
Denpasar, 67.
Hakim, Ayu Aulia, & Guntur, Harus Laksana. (2017). Pemodelan dan analisis pengaruh
perubahan parameter variable orifice sistem suspensi hidrolik terhadap gaya
redam yang dihasilkan dan respon dinamis penumpang pada sepeda motor honda
beat 2009. Sepuluh Nopember Institute of Technology.
Kushwah, Jitendra Singh, Kumar, Atul, Patel, Subhash, Soni, Rishi, Gawande, Amol, &
Gupta, Shyam. (2022). Comparative study of regressor and classifier with decision
tree using modern tools. Materials Today: Proceedings, 56, 35713576.
Prayitno, Yansen, & Wasiwitono, Unggul. (2016). Pemodelan Gerak Belok Steady State
dan Transient pada Kendaraan Empat Roda. Jurnal Teknik ITS, 5(2), E99E104.
Putra, Muhamad Rai Anggara. (2017). Pemodelan dan analisis pengaruh penggunaan
adaptive shock absorber menggunakan variabel orifice terhadap karakteristik gaya
redam dan respon dinamis kendaraan. Institut Teknologi Sepuluh Nopember.
Putri, Octavia Kanjeng, & Herison, Ahmad. (2019). Analisis kemacetan lalu lintas di
suatu wilayah (studi kasus di jalan teuku umar, bandar lampung). Analisis
Kemacetan Lalu Lintas Di Suatu Wilayah (Studi Kasus Di Jalan Teuku Umar,
Bandar Lampung).
Saputri, Tari, Nugraha, Cahyadi, & Amila, Khuria. (2014). Model simulasi untuk
pergerakan kendaraan pada ruang dua dimensi kontinu dengan pendekatan
pemodelan berbasis agen. Reka Integra, 2(4).
Triwibisono, Christanto, & Aurachman, Rio. (2020). Pemecahan Masalah Kemacetan
Lalu Lintas Di Perempatan Sukarno HattaBuah Batu Bandung Dengan Metode
Simulasi Komputer. Jurnal Manajemen Industri Dan Logistik, 4(1), 7583.