routing_state_cr.m
来自「best routing protocol」· M 代码 · 共 19 行
M
19 行
function states =routing_state_cr(res)USE_BYTE_OR_N_ENTRY = 1; %=1: use byte, =0: use number of entriesNEXT_HOP_COST = 2; % 2 bytes to store a nexthop entryBYTE_PER_PCR = 2+1+NEXT_HOP_COST; %byte per each pcr routing entry%dest:2, scope:.5, seq:.5, nexthop:2 //no hops needed if use%certain optimizationBYTE_PER_BEACON = 2+1+1+NEXT_HOP_COST;n_beacon = length( res.beacons );if USE_BYTE_OR_N_ENTRY states = res.cluster_cr*BYTE_PER_PCR... + repmat(n_beacon*(BYTE_PER_BEACON), length(res.cluster_cr),1);else states = res.cluster_cr;end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?