Research Article

Hexagon-Based Generalized Voronoi Diagrams Generation for Path Planning of Intelligent Agents

Algorithm 2

Pseudocode for the hexagon-based crystal-growth algorithm.
GenerateCrystalGrowthRoughGVDEdges()
(1)while unCrystalCellList ≠ Ø do
(2)  for all sbcl ∈ boundCellList do
(3)   for all s ∈ sbcl.cSiteCells do
(4)    for n ∈ Adj6(s) do
(5)  if typen ≠ OBST then
(6)   if typen = = EMPTY then
(7)    typen ⟵ OCCUPY
(8)    obstn ⟵ obsts
(9)     distn ⟵ dists + 1
(10)     insert(tempSBC. cSiteCells, n)
(11)     unCrystalCellList.pop(n)
(12)    else if typen = = OCCUPY then
(13)     if obstn ≠ obststhen
(14)     typen ⟵ EDGE
(15)   insert(newSBCL, tempSBC)
(16)  boundCellList ⟵ newSBCL
(17) markCrystalRoughEdge()
markCrystalGrowthRoughGVDEdges()
(18)for all s ∈ allCellList do
(19)  if types = = EDGE then
(20)  e ⟵ findEdge(s)
(21)   if e = = Ø then
(22)  e ⟵ Edge()
(23)   obste ⟵ obsts
(24)  insertEdge(e)
(25)  insertCell(e, s)
(26) insertQueue(roughQueue, s, dists)
(27)pruningEdgeCell()