Research Article

A Two-Stage Path Planning Method for the Rearrangement Problem in Modular Puzzle-Based Storage System

Algorithm 3

MPOCS (S, isrc, ides, dir).
Input: the current state S, the source slot isrc of item, the destination slot ides to be moved to, the moving direction dir.
Output: single move sequence that moves the item at slot isrc to slot ides.
(1) Initialize,
(2)if dir = 1 then
(3)  
(4)  whiledo
(5)   itemp = next
(6)   while type(itemp)≠0 do
(7)    itemp = next(itemp)
(8)   end while
(9)   , , update S
(10)   if = previous(itemp) then
(11)     = next
(12)   end if
(13)  end while
(14) else
(15)  
(16)  whiledo
(17)   itemp = previous
(18)   while type(itemp)≠0 do
(19)    itemp = previous(itemp)
(20)   end while
(21)   , , update S
(22)   if = next(itemp) then
(23)     = previous
(24)   end if
(25)  end while
(26) end if
(27)return