Skip to main content
. 2026 Sep 30;26(19):6208. doi: 10.3390/s26196208
Algorithm 3: Parts configuration
1. Given: occupancy matrix M [3,3]
2. Initialize: M [i,j] = 0
3. k = 1
4. while k ≤ Np do
5.  o ← O(k), o ∈ {H,V}
6.  (i,j) ← P(k)
7.  if V(i,j,o) = 1 then
8.       if o = H then
9.           M(i,j) ← k
10.        M(i,j + 1) ← k
11.     else
12.        M(i,j) ← k
13.        M(i + 1,j) ← k
14.     end if
15.     k ← k + 1
16.  else
17.     (i,j) ← Next(i,j)
18.  end if
19. end while
20. return M