一个模拟器相似性Beetweness协议中的元组数据结构

时间:2019-03-01 08:16:24

标签: java methods data-structures tuples one-simulator

我想将一个节点的数据输入一个名为Neighbourhood的Tuple类型的数据结构中,但是在调用它时遇到了错误,您能帮我吗?

此处是源代码

protected Tuple<Map<DTNHost, Set<DTNHost>>,Map<DTNHost,ArrayList<Double>>> neighborhood;



public void doExchangeForNewConnection(Connection con, DTNHost peer) {

    DTNHost myHost = con.getOtherNode(peer);
    SimBetRouterWithFairRouting de = this.getOtherDecisionEngine(peer);

    double sigma = 0;
    double lambda = 0;
    double time = 0;
    /** If the node has meet before */
    if (this.neighboursNode.containsKey(peer) && this.neighborsHistory.containsKey(peer)) {
        de.neighboursNode.replace(myHost, this.neighboursNode.keySet());
        this.neighboursNode.replace(peer, de.neighboursNode.keySet());

    } else {

        de.neighboursNode.put(myHost, this.neighboursNode.keySet());
        this.neighboursNode.put(peer, de.neighboursNode.keySet());

        ArrayList<Double> nodeInformationList = new ArrayList<Double>();
        nodeInformationList.add(lambda);
        nodeInformationList.add(sigma);
        nodeInformationList.add(time);

        this.neighborsHistory.put(peer, nodeInformationList);
        de.neighborsHistory.put(myHost, nodeInformationList);
    }

    this.updateBetweenness(myHost); // mengupdate nilai betweenness
    this.updateSimilarity(myHost); //mengupdate indirect node
    this.updatePerceiveInteractionStrength(peer);
}

我想将neigboursNode和neighboursHistory数据结构更改为邻域数据结构,并且neighboursNode的类型为:

 protected Map<DTNHost, Set<DTNHost>> neighboursNode; 

,neighboursHistory类型为:

  protected Map<DTNHost, ArrayList<Double>> neighborsHistory;

,错误提示:无法解析方法

0 个答案:

没有答案