## 3 Resource Scheduling and Collision Resolution in Sidelink Mode 4
### Reselection  
Each packet transmitted in a streak, each RRI apart from the previous one, decrements the RC counter by one. The streak length, namely the RC counter, is randomly set to one value in \([C1,C2]\). The range of the random number depends on the RRI. It is \([C1,C2]=[5,15]\) if RRI is 100 ms or higher, in \([10,30]\) if RRI is 50 ms, and in \([25,75]\) if RRI is 20 ms. Notice that the average length of the streak is designed to last only a second, hence semi-persistent scheduling. When RC reaches 0, the next streak should be scheduled. This operation is called _reselection_. First, a decision is made as to whether a different resource should be chosen from the selection window using sensing again or the current resource location is kept. In the latter case, the same RRI is maintained between the last packet in the current streak and the first packet in the next streak. The decision is controlled by the resource keeping probability _probResourceKeep_ that the upper layers configure [20]. For the decision, a random number in the interval \([0,1]\) is generated, and if it is larger than _probResourceKeep_, a different resource should be used for the next streak. Otherwise, the UE continues to use the current resource. In either case, however, a new RC counter value should be decided as above, according to the RRI. Figure 1 shows an example where the UE is at the point of deciding whether it should change the resource location with probability \((1-p)\) or it should maintain the current resource for another streak with \(p\). The standards stipulate that the probability \(p\) in the figure, _probResourceKeep_, should be configured to be between 0 and 0.8. As we discussed in Section 1, there are two reasons why we keep reselecting resources. With only a few choices of RRI [20], without any collision resolution mechanism similar to DSRC, and with multiple packets transmitted in a single streak, UEs can collide multiple times without knowing it. Therefore, the streak is designed to last only a second on average so that any colliding UEs can part from the other in a second. The packet collisions can also occur when new vehicles join the group of vehicles that are already coordinating the resource use through the sensing-based SPS. In this paper, we focus on this reselection step to improve the packet collision mitigation performance. Thus, we assume that \(S_{B}\) has been already computed according to the standard. Algorithm 1 describes the reselection part in the SPS algorithm, to be used for our simulation experiments below. ```
1:procedureSPS (\(RRI\), \(T1\), \(T2\), \(C1\), \(C2\), \(N_{subCH}\), \(probResourceKeep\))
2:\(txSubCH\gets random(1,N_{subCH})\)\(\triangleright\) Initializations for \(txSubCH,txSubframe,RC\)
3:\(txSubframe\gets random(1,RRI)\)
4:\(RC\gets random(C1,C2)\)
5:\(subframe\gets 0\)\(\triangleright\) This is the current time
6:
7:whileTrue do
8:ifsubframe\(==txSubframe\)then\(\triangleright\) It is time to transmit
9:\(txPacket(txSubCH)\)\(\triangleright\) Transmit packet on the specified subchannel(s)
10:if\(RC\
eq 0\)then\(\triangleright\) Not time for reselection yet
11:\(txSubframe\gets txSubframe+RRI\)\(\triangleright\) Schedule next packet in one RRI
12:\(RC\gets RC-1\)
13:else\(\triangleright\) Time to reselect for next streak
14:\(RC\gets random(C1,C2)\)
15:if\(random(0,1)<probResourceKeep\)then\(\triangleright\) Should keep the same resource location
16:\(txSubframe\gets txSubframe+RRI\)\(\triangleright\) Maintain the same RRI across streaks
17:else\(\triangleright\) Must move to other location for the next streak
18: callselect_resource()\(\triangleright\) Reselect \(txSubCH\) and \(txSubframe\); Section 3.2
19:endif
20:endif
21:else
22: callsensing_update()\(\triangleright\) Keep sensing and update resource use map; Section 3.1
23:endif
24:\(subframe\gets subframe+1\)\(\triangleright\) Push time
25:endwhile
26:endprocedure
```  
**Algorithm 1** Reselection by a UE in SPS  
In Algorithm 1, \(txSubCH\) is the subchannel where the UE will transmit its BSMS in the next streak.