Ejemplo n.º 1
0
 //执行参数计算
 void Calculate()
 {
     //距离参数
     if ((intChoice & intDistance) == intDistance)
     {
         disStrategy = new DistanceStrategy(curNetwork.Number);
         disStrategy.Calculate(curNetwork);
         tabMain.TabPages.Add(tabDistance);
         LoadDistanceResult(disStrategy);
     }
     //中心度参数
     if ((intChoice & intCenter) == intCenter)
     {
         coeStrategy = new CoefficientStrategy(curNetwork.Number);
         coeStrategy.Calculate(curNetwork);
         tabMain.TabPages.Add(tabCenter);
         LoadCenterResult(coeStrategy);
     }
     //PageRank
     if ((intChoice & intPageRank) == intPageRank)
     {
         prStrategy = new PageRankStrategy(curNetwork.Number);
         prStrategy.Calculate(curNetwork, 30);
         tabMain.TabPages.Add(tabPageRank);
         LoadPageRankResult(prStrategy);
     }
     //K-Shell
     if ((intChoice & intKshell) == intKshell)
     {
         kshellStrategy = new KShellStrategy(curNetwork.Number);
         kshellStrategy.Calculate(curNetwork);
         tabMain.TabPages.Add(tabKshell);
         LoadKshellResult(kshellStrategy);
     }
 }
Ejemplo n.º 2
0
 //读取中心度参数计算结果
 void LoadCenterResult(CoefficientStrategy coeStrategy)
 {
     AveClusterBox.Text = Convert.ToSingle(coeStrategy.AveCluster).ToString();
     AveLoopBox.Text = Convert.ToSingle(coeStrategy.AveLoop).ToString();
     AveCloseBox.Text = Convert.ToSingle(coeStrategy.AveClose).ToString();
 }