Skip to main content
. 2018 Feb 8;18(2):512. doi: 10.3390/s18020512
Algorithm 1 Rebalancing strategy
1: Initialize i=0, V={0}, f(H,t)=0, done =0
2: Set parameters α,β,γ,X
3: Set S(t)=[S1(t,m1()),,S|V|(t,m|V||())] ▹ Vector with survival times before rebalancing
4: Set σ=minwVS(t) ▹ Smallest survival time before rebalancing
5: σ=min{σ,γ} ▹ Set the survival time threshold
6: Set S(t)=[S1(t),,S|V|(t)] ▹ Vector with optimal survival times for each station vV
7: while (i<V) and (done ==0) do ▹ Until there are nodes to visit that can improve the net reward
8: ii+1
9: v(i)argminwV\VS(t) ▹ Choose unvisited node with smallest survival time
10: [S(t)]v(i)[S]v(i)(t) ▹ Update survival time of node v(i)
11: rewardmin{minS(t),γ}σ ▹ Update reward
12:  Determine rebalancing path F over Vv(i)
13: D compute path length of F ▹ Compute distance to cover for rebalancing
14: costαX+βD ▹ Update cost
15: if (reward − cost) >f(H,t) then ▹ It is worth to include node v(i) in the rebalancing
16:   VVv(i)
17:   f(H,t) reward − cost
18: if minwV{[S(t)]w}<minwV\V{[S(t)]w} then
19:   done 1 ▹ The optimization function f(H,t) can no longer be increased