Examples of avgGap()


Examples of net.tomp2p.p2p.Statistics.avgGap()

        System.out.println("peer[0] got " + futureGet1.data().object());

        // countermeasure - statistics, pick not closest, but random peer that has the data - freshness vs. load
        // also, check distances!
        Statistics statistics = new Statistics(peers[0].peerBean().peerMap());
        System.out.println("average distance: "+statistics.avgGap());
        for (Entry<PeerAddress, Map<Number640, Data>> entry : futureGet1.rawData().entrySet()) {
            System.out.print("got from (6)" + entry.getKey());
            System.out.print(" distance: "+key1.xor(entry.getKey().peerId()).doubleValue());
            System.out.println(" "+entry.getValue());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.