Skip to main content
. 2022 Nov 23;22(23):9077. doi: 10.3390/s22239077
Algorithm 2 Dynamic adaptation to new services.
Let N be the node requesting the service Snew.
Given a new service Snew={Pnew,Qnew} with processing unit Pnew and related QoS Qnew such that each Qkj is a finite set of n quality choices for the jth attribute, expressed in decreasing order of preference, for all k QoS dimensions. Let A be a global variable that stores the set of available nodes in the cluster.
Let SC={} be the sub cluster that will provide the new service.
Let N broadcast to the local network the request for nodes to register adding them to A.
while t < timeout do
       for each diA do
             Let Qj be the QoS delivered by node di
             if Qj is higher (in all its dimensions) than Q then
                   if di can accommodate such service along existing ones then
                         SC=SC{di}
                   end if
             end if
        end for
end while
return SC