| Input: |
| V, (xcn, ycn), t1, t2, d, Cset, pif |
| Output: |
| setMigration {rsuMigration, mscnMigration} |
| for Vtarget each in V |
| (xt1,yt1) ← get_position (Vtarget,t1); |
| (xt2,yt2) ← get_position (Vtarget,t2); |
| cellnum1 ← getcell_num ((xt1, yt1),(xcn, ycn)); |
| cellnum2 ← getcell_num ((xt2, yt2),(xcn, ycn)); |
| MSCNid1 ← get_MSCN (cellnum1); |
| MSCNid2 ← get_MSCN (cellnum2); |
| rsu1 ← get_rsu (MSCNid1); |
| rsu2 ← get_rsu (MSCNid2); |
| if (MSCNid1 = = MSCNid2) then |
| rsuMigration.insert (Vtarget, false); |
| else |
| mscnMigration.insert (Vtarget, true); |
| end |
| if (rsu1 = = rsu2) then |
| rsuMigration.insert (Vtarget, false); |
| else |
| S ← get_strategy (pif,Cset); |
| if (d > S) then |
| rsuMigration.insert (Vtarget, true); |
| update pif; |
| else |
| rsuMigration.insert (Vtarget, false); |
| end |
| end |
| end for |
| Return setMigration; |