## 7 Conclusions
**Data Availability Statement:** The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding authors. **Conflicts of Interest:** The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results. **Abbreviations**  
_Indices and Sets_  
\(I\) & Set of microgird nodes, \(i,j\in I\). \(I_{1}\) & Pre-positioning nodes for MES device connection in the first stage, \(p\in I_{1}\). \(I_{2}\) & Re-allocation nodes for MES device connection in the second stage, \(k\in l_{2}\). \(F\) & Set of generation nodes. \(M\) & Set of MES devices, \(m\in M\). \(N\) & Set of scenarios, \(n\in N\). \(TL\) & Set of distribution lines, \(l_{ij}\in TL\). \(BL\) & Set of boundary lines, \(l_{ij}\in BL\). \(DL_{m}\) & Set of damaged lines under scenario \(n\). _Parameters_  
\(N_{g}\) & Number of microgird nodes. \(N_{p}\) & Maximum number of MES devices available at the pre-positioning node \(p\). \(N_{bl}\) & Number of boundary lines in the NMGs. \(BM\) & Budget of MES devices. \(BD\) & Budget of damaged distribution lines. \(G_{F}\) & Capacity of generation nodes. \(G_{M}\) & Maximum design capacity of MES devices. \(T_{pkn}\) & Travel time of an MES device from pre-positioning node \(p\) to re-allocation node \(k\) under scenario \(n\). \(r_{l_{ij}}\) & Reactance of line \(l_{ij}\). \(o(l_{ij})\) & Origin node of line \(l_{ij}\). \(d(l_{ij})\) & Destination node of line \(l_{ij}\). \(W_{n}\) & Weight of scenario \(n\). \(Z_{i}\) & Priority weight of node i  
\(P_{i}\) & Power demand at node \(i\). \(\gamma_{i}\) & Weight of the i-th objective. _Variables_  
\(G_{m}\) & Actual purchasing capacity of MES \(m\). \(gm_{imn}\) & Generation level of node \(i\) supported by MES \(m\) under scenario \(n\). \(gf_{in}\) & Generation level of generation node \(i\) under scenario \(n\). \(sl_{in}\) & Shed loads on node \(i\) under scenario \(n\). \(l_{ij}\) & Binary: 1 if there is a line connecting node \(i\) and node \(j\), and 0 otherwise. \(al_{ijn}\) & Binary: 1 if line \((i,j)\) is attacked under scenario \(n\), and0 otherwise. \(bl_{ijn}\) & Binary: 1 if the switch on boundary line \((i,j)\) is closed under scenario \(n\), and 0 otherwise. \(tl_{ijn}\) & Binary: 1 if the switch on distribution line \((i,j)\) is closed under scenario \(n\), and 0 otherwise. \(\alpha_{mpp}\) & Binary: 1 if MES \(m\) is pre-positioned to node \(p\), and 0 otherwise. \(\beta_{mppkn}\) & Binary: 1 if MES \(m\) is re-allocated (sent) from node \(p\) to node \(k\) in real time under scenario \(n\), and 0 otherwise. \(\gamma_{imn}\) & Otherwise. \(pm_{kn}\) & Binary: 1 if an MES device is connected to node \(k\) under scenario \(n\), and 0 otherwise. \(pf_{kn}\) & Binary: 1 if node \(k\) is a generation node under scenario \(n\), and 0 otherwise. \(p_{l_{ij}}\) & Power flow of line \(l_{ij}\) under scenario \(n\). \(\lambda_{ijn}\) & Auxiliary binary variable to replace the nonlinear term \((bl_{ijn}+tl_{ijn})(1-al_{ijn})\). \(\phi_{ijn}\) & Auxiliary continuous variable to replace the nonlinear term \(\lambda_{ijn}(\phi_{(l_{ij})}-\delta_{d(l_{ij})})\).