## 4 Methods
### Case Study Simulation in Unity
#### 4.2.2 Trucks' Travel Priorities  
Time-space conflicts may occur in construction sites, leading trucks' travel paths to overlap at a given time, either partially or entirely. To avoid such conflicts, our solution is to consider trucks' priorities. We consider that the truck serving the higher-priority construction activity has the right of way to avoid conflicts. Our case study assumes that the SmallTruck (red cube) serves the higher-priority construction activity and, therefore, has the right of way. Therefore, if time-space conflicts occur during the trucks' travel, the LargeTruck (blue cube) waits until the SmallTruck (red cube) leaves the intersection zone. Setting the travel priorities includes the following steps:  
* Finding the intersection points of the trucks' paths
* Finding the stop and start point for the blue cube
* Modeling all possible scenarios for the cubes' travel paths  
Finding the Intersection Points of the Trucks' Paths  
In this section, we calculated the following attribute lists for the trucks' travel paths to find probable intersection points. path list. Contains the points \(p_{i}\) on the blue cube travel path according to Equations (2) and (3). \[p_{i}=(x_{i},\,y_{i})\ \ ;\ \ i=0,\,1\ldots,\,n \tag{2}\]  
\[path=\{p_{i}\}\ \ ;\ \ i=0,1\ldots,\,n \tag{3}\]  
timeLablePath list. Contains the time it takes for the blue cube to reach any point of the path which was calculated based on the distance between any two consecutive points of the path and the trucks' speed (Equations (4) and (5)). Here, \(t_{i}\) is the time taken by the blue cube to reach a point \(p_{i}\), and \(path_{i}\) represents member \(i\) of the \(path\). \[t_{i+1}=t_{i}+\frac{\left|path_{i+1}-path_{i}\right|}{speed}\ \ ;\ \ i=0,\,1 \ldots,n \tag{4}\]  
\[timeLablePath=\{(t_{i})\}\ \ \ \ \ ;\ \ i=0,\,1\ldots,\,n \tag{5}\]  
slope (m) and intercept (b) list. The slope and the intercept of the line between any two consecutive points of the \(path\) were calculated and stored in the \(m\) and \(b\) lists, respectively (Equations (6)-(9)). Here, \(p_{i}(x_{i})\) and \(p_{i}(y_{i})\) are the X and Y coordinates of  
Figure 9: An example of a truck’s travel path mapping using Informed-RRT*. Black circles represent the obstacles and red line shows the shortest travel path. the point \(p_{i}\), respectively. \(m_{i}\) and \(b_{i}\) are the slope and the intercept of the line between \(p_{i}\) and \(p_{i+1}\), respectively. \[m_{i}=\frac{p_{i+1}(y_{i+1})-p_{i}\;(y_{i})}{p_{i+1}\;(x_{i+1})-p_{i}\;(x_{i})}\; \;;\;\;i=0,\;1\ldots,\;n-1 \tag{6}\]  
\[m=\{m_{i}\}\;\;\;\;\;;\;\;\;i=0,\;1\ldots,\;n-1 \tag{7}\]  
\[b_{i}=p_{i+1}(y_{i+1})-(m_{i+1}\times\;p_{i+1}\;(x_{i+1}))\;\;\;;\;\;i=0,\;1 \ldots,\;n-1 \tag{8}\]  
\[b=\{b_{i}\}\;\;\;\;;\;\;\;i=0,\;1\ldots,\;n-1 \tag{9}\]  
Similarly, the three attributes of the red cube's travel path from the origin point to a given destination point were calculated. An example of the blue cube's path with path's points \((p_{i})\), slopes \((m_{i})\), intercepts \((b_{i})\), and the time taken to reach the points along the path \((t_{i})\) are shown in Figure 10.  
To find the intersection points of the trucks' path, such as \(P_{intersection}\), the intersection points between each line in the path of the blue cube and each line in the path of the red cube were calculated (Figure 11). The Stop and Start Point for the Blue Cube  
In this section, we defined 4 critical points of \((p_{stop}),\;(p_{exit}),\;(q_{stop})\), and \((q_{exit})\) to be used in our calculations. If the blue cube passes the points \((p_{stop})\) and \((p_{exit})\), it will enter and exit the critical conflict area. Similarly, if the red cube passes the points \((q_{stop})\) and \((q_{exit})\), it will enter and exit the critical conflict area. Also, the critical point \((p_{stop})\) is the optimal point where, if the blue cube stops, no collision with the red cube occurs. If the blue cube passes through the point \((p_{stop})\) and then stops, time-space conflicts will occur.