gps.protocol.BT.algorithm
Class BTAlgorithmPeerSelectionAtPeer

java.lang.Object
  extended by gps.protocol.BT.algorithm.BTAlgorithmPeerSelectionAtPeer

public class BTAlgorithmPeerSelectionAtPeer
extends java.lang.Object

selects peers to send request

Version:
1.2, 6/20/2005
Author:
Weishuai Yang

Field Summary
static int DEFAULT_PEER_NUM_LIMIT
          default peer number to send request
 int peerNumLimit
          peer number to send request
 
Constructor Summary
BTAlgorithmPeerSelectionAtPeer(int n)
          constructs peer selection algorithm object
 
Method Summary
 java.util.ArrayList selectPeers(java.util.List list)
          selects peers having documents from peers local record
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PEER_NUM_LIMIT

public static int DEFAULT_PEER_NUM_LIMIT
default peer number to send request


peerNumLimit

public int peerNumLimit
peer number to send request

Constructor Detail

BTAlgorithmPeerSelectionAtPeer

public BTAlgorithmPeerSelectionAtPeer(int n)
constructs peer selection algorithm object

Parameters:
n - seed for random object
Method Detail

selectPeers

public java.util.ArrayList selectPeers(java.util.List list)
selects peers having documents from peers local record

Parameters:
list - local record of peers having this document
Returns:
peer list to send request to one difference of the slectPeers algorithm between peer side and tracker side is that selected nodes are removed from the passed-in list for the peer side selection, but not for tracker side selection.