local TransmitManager = {}
local this = TransmitManager
—用lua写的一个多源最短路径解决方案,floyd算法
—初始化数据
function TransmitManager.Init()
this.m_transmitPoint = {} --处理过的数据{A点 {与A链接的点}}
this.m_array = {} --路径的二维数组
this.path = {} – 中间点
this.long64Point = 0 --默认没有激活点 (64位)
end
–处理过的数据{A点 {与A链接的点}…}
function TransmitManager.DealCFGData()
–this.m_transmitPoint = ?
end
—flody,
function TransmitManager.CfgData2Arr()
local data = this.m_transmitPoint
local count = table.count(data)
local max = 9999999
–初始化一个矩阵
for i = 1,count do
local array = {}
for j = 1, count do
if j == i then
array[j] = 0
else
if data[i] == nil or data[i].list == nil or data[i].list[j] == nil then
array[j] = max
else
array[j] = (this.PointAct(i) and thi