Skip to main content
. 2021 Apr 26;23(5):532. doi: 10.3390/e23050532
Algorithm 2. Candidate Selection by Partial Vector Bin Packing
1 Input:
2 ω the weight for traffic as metric
3
4 P the set of candidates of the final plan
5 for eachvVdo
6          𝕔v.C0
7          P.Apply𝕔
8 end for
9
10 whiletruethen
11         nrnull // the reconfigure node
12         for each nN do
13                 rncpu.req,rnmem.req,rnsto.reqGetRequiredResourcesn,P
14                 if rncpu<rncpu.req  rnmem<rnmem.req rnsto<rnsto.req then
15                         nrn
16                         Break
17                 end if
18         end for
19         if nr=null then break
20         metricmax
21         μa, σaGetAngleStatsP
22         μτd, στdGetTrafficDiffStatsP,V
23         rnrnrcpu,rnrmem,rnrsto
24         for each snr.S do
25                 rsrscpu,rsmem,rssto
26                 αcos1(rn·rs)/rnrs
27                 𝕔nextGetNextCandidates
28                 if 𝕔next=null then continue
29                 τdGetTrafficDiff𝕔s,𝕔next
30                 αzαμα/σα
31                 τdzτdμτd/στd
32                 metricαz×1ωτdz×ω
33                 if metricmax<metric then
34                         metricmaxmetric
35                         srs
36                 end if
37         end for
38         P.Remove𝕔sr
39         𝕔nextGetNextCandidatesr
40         if 𝕔next=null then break
41         else thenP.Apply𝕔next
42         end if
43 end while
44
45 Output:
46 returnvalid ?P: