Research Article

A Vehicular Service-Oriented Dynamical Routing Searching Algorithm in Software-Defined BusNet

Algorithm 2

SPSO.
input: request, velocity, position
output: path
(1)if velocity = = null || position = = null then
(2) initializeParticle ()
(3)end if
(4)p [i] ⟵ getPresentParticle ()
(5)path ⟵ getMinTrainingEvaluationPath (request, p [i])
(6)[Gpi loss delay] ⟵ getGeneralizationEvaluation (path)
(7)update_pBest (Gpi)
(8)update_gBest (Gpi)
(9)fori = 0 ⟶ k − 1 do
(10)  velocity [i] ⟵ updateVelocity (p [i])
(11)  position [i] ⟵ updatePosition (p [i])
(12)end for
(13)return path