# A Grant-Free Random Access Process for Low-End Distribution System Using Deep Neural Network
## 4 The Algorithm  
As already mentioned, the algorithm tells which station needs to transmit. To achieve this feat, we divide our task into two parts. In the first part, we use our proposed algorithm, Algorithm 1, to train the DNN model. In the second part, the trained DNN is used to predict the transmission of the desired station. Here, we first explain the algorithm, and then later, the DNN model is also explained. The main parameter on which the algorithm depends is the channel coefficient represented by \(CC\in(0,1)\). The other secondary but equally important parameters are the channel outcome represented by \(CO\) and the previous three transmissions, represented by \(PT\). \(CO\) is the outcome of the channel such as idle, success, and collision, represented by \(0\), \(1\), and \(2\), respectively. \(PT\) is the previous three transmissions of each station, whether the previous three transmissions have collided or not. Let us denote by \(T\), the threshold used to make decisions based on \(CC\).  
For each device, the \(CC\) is checked to see whether it is above the threshold \(T\) or not. \(CC\) is the representation of the channel between the station and the eNodeB. A higher value of \(CC\) represents a good channel whereas a bad channel has a smaller value of \(CC\). If no device has \(CC>T\), this means that no device in any station is eligible for the transmission, and the outcome of the channel is considered to be idle. This condition happens in lightly loaded traffic, where the arrival of the devices at stations is very sporadic. If only one device meets the condition \(CC>T\), then it is a success, because it is the only device that is eligible for transmission. The other devices simply refrain from transmitting as they are not eligible. However, if more than one device fulfills the condition \(CC>T\), then success cannot be guaranteed, and other conditions also need to be checked. At this point, the other parameter with the condition \(PT\
eq 3\) is checked. If only one device fulfills this condition, then it is a success. The other devices that fulfill the \(CC>T\) condition but could not fulfill the \(PT\
eq 3\) condition are prevented from transmitting, resulting in success. It is possible that more than one device fulfills both the above-mentioned conditions, and then comes the third condition \(CO=1\). Similarly, if only one device has \(CO=1\) then it is a success, otherwise, it is a collision. So, by incorporating multiple conditions, the probability of success is increased. It becomes extremely useful especially in lightly loaded conditions where the arrival of devices is not in bursts. Therefore, we see that the algorithm largely depends on \(T\) and associated conditions. A careful choice of \(T\) may result in a better performance of the system which is discussed in the next section.  
Figure 4: System model: Multiple devices transmission on single channel.  
```
1: Initialize \(N\), \(M\), \(CO=0\), \(PT=0\)
2: For each device check the channel coefficient \(CC>T\)
3:if no device has \(CC>T\)then
4: the event is idle
5:else if one device has \(CC>T\)then
6: the event is a success
7:else if more than one device has \(CC>T\)then
8: check for a value of \(PT\
eq 3\)
9:if one device has \(PT\
eq 3\)then
10: the event is a success
11:else if then
12: check for the value of \(CO=1\)
13:if one device has \(CO=1\)then
14: the event is a success
15:else if then
16: the event is collision
17:endif
18:endif
19:endif
20: Update \(CO\) and \(PT\)
```  
**Algorithm 1** Algorithm to train the DNN