xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 308KB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-05-27
  • 語言: 其他
  • 標(biāo)簽: peersim??pastry??

資源簡介

用peersim實(shí)現(xiàn)的pastry算法,可以在eclipse下運(yùn)行

資源截圖

代碼片段和文件信息

package?peersim.pastry;

import?peersim.core.CommonState;
import?peersim.config.Configuration;
import?peersim.core.Network;
import?java.math.BigInteger;

//______________________________________________________________________________________________
/**
?*?This?control?initializes?the?whole?network?(that?was?already?created?by?peersim)?by?assigning?a
?*?unique?NodeId?randomly?generated?to?every?node?(it?does?nothing?else).
?*?

title:?MSPASTRY


?*
?*?

Description:?MsPastry?implementation?for?PeerSim


?*
?*?

Copyright:?Copyright?(c)?2007


?*
?*?

Company:?The?Pastry?Group


?*
?*?@author?Elisa?Bisoffi?Manuel?Cortella
?*?@version?1.0
?*/
public?class?CustomDistribution?implements?peersim.core.Control?{

????//______________________________________________________________________________________________
????private?static?final?String?PAR_PROT?=?“protocol“;

????private?int?protocolID;
????private?UniformRandomGenerator?urg;


????//______________________________________________________________________________________________
????public?CustomDistribution(String?prefix)?{

????????protocolID?=?Configuration.getPid(prefix?+?“.“?+?PAR_PROT);
????????urg?=?new?UniformRandomGenerator(MSPastryCommonConfig.BITS?CommonState.r);
????}


????//______________________________________________________________________________________________
????/**
?????*?Scan?over?the?nodes?in?the?network?and?assign?a?randomly?generated?NodeId?in?the?space
?????*?0..2^BITS?where?BITS?is?a?parameter?from?the?pastry?protocol?(usually?128)
?????*?@return?boolean?always?false
?????*/
????public?boolean?execute()?{
???????BigInteger?tmp;
???????for?(int?i?=?0;?i????????????tmp?=?urg.generate();
???????????((MSPastryProtocol)(Network.get(i).getProtocol(protocolID))).setNodeId(tmp);
???????}

????????return?false;
????}

????//______________________________________________________________________________________________
}?//?End?of?class

評論

共有 條評論