Research Article

Multiagent Task Planning Based on Distributed Resource Scheduling under Command and Control Structure

Algorithm 1

HTN algorithm Pseudo Code.
(1)HTN
(2)if can be shown to have no solution
(3) Then return failure
(4)else if is primitive then
(5) if has a solution then
(6)  nondeterministically let be any such solution
(7)  return
(8) else return failure
(9)else
(10) choose a nonprimitive task node
(11)
(12) if then
(13)  nondeterministically choose any
(14)   an mgu for and that renames all variables of
(15)  
(16)   ⟵ apply-critic
(17)  return HTN
(18) else return failure