Skip to main content
. 2023 Jan 13;23(2):923. doi: 10.3390/s23020923
Algorithm 1 Congestion detection function
Data: C, DP, CAF, and Result: Congestion level: state
1 if (current_state = = I) then
2    if ((TLow ≤DP < THigh) and (TLow ≤ CAF < THigh) AND (TLow ≤ C < THigh)) then
3       current_state = II; congestion_resolution (state II);
4    else if ((CAF ≥ THigh) OR (C ≥ THigh) OR (DP ≥ THigh)), then
5       current_state = III; congestion_resolution (state III);
6    end
7 else if (current_state = = II) then
8    if ((DP ≥ THigh) OR (CAF ≥ THigh) OR (C ≥ THigh)), then
9         current_state = III; congestion_resolution (state III);
10    else if ((DP < TLow) AND (CAF < TLow) AND (C < TLow)) then
11       current_state = I; congestion_resolution (state I);
12    end
13 else if (current_state = = III) then
14    if ((TL ≤ DP < THigh) AND (TLow ≤ CAF < THigh) AND (TLow ≤ C < THigh)) then
15       current_state = II; congestion_resolution (state II);
16    else if ((DP < TLow) AND (CAF < TLow) AND (C < TLow)) then
17       current_state = I; congestion_resolution (state I);
18    end
19 end