Query Cycle Simulator HEADER

qcsim.peer
Interface PeerManager

All Known Implementing Classes:
PeerManagerImpl

public interface PeerManager

Creates and manage all peers in a simulation.

Version:
1.0
Author:
unascribed

Field Summary
static int MC_CHAIN
           
static int MC_CLIQUE
           
static int MC_RANDOM
           
 
Method Summary
 void collective(java.util.Vector peers, int collective, int type)
          Create a collective.
 void contentManager(PeerContentManager manager)
          Set the peer content manager
 void deletePeer(int peerID)
          Removes peer from the system.
 int goodPeers()
          Get the number of good peers in the system.
 int highlyTrustedPeers()
          Get the number of highly trusted peers in the system.
 int maliciousPeers()
          Get the number of malicious peers in the system.
 Peer newPeer(NetworkSimulator network, int behavior)
          Create a new peer
 Peer peer(int peerID)
          Get peer
 int peers()
          Number of peers in the system.
 

Field Detail

MC_CLIQUE

public static final int MC_CLIQUE
See Also:
Constant Field Values

MC_CHAIN

public static final int MC_CHAIN
See Also:
Constant Field Values

MC_RANDOM

public static final int MC_RANDOM
See Also:
Constant Field Values
Method Detail

peers

public int peers()
Number of peers in the system.

Returns:
number of peers.

peer

public Peer peer(int peerID)
Get peer

Parameters:
peerID - the peer id.
Returns:
the peer.

newPeer

public Peer newPeer(NetworkSimulator network,
                    int behavior)
Create a new peer

Parameters:
behavior - the peer's behavior/type
Returns:
the peer.

deletePeer

public void deletePeer(int peerID)
Removes peer from the system.

Parameters:
peerID - the peer id.

highlyTrustedPeers

public int highlyTrustedPeers()
Get the number of highly trusted peers in the system.

Returns:
number of highly trusted peers.

maliciousPeers

public int maliciousPeers()
Get the number of malicious peers in the system.

Returns:
number of malicious peers.

goodPeers

public int goodPeers()
Get the number of good peers in the system.

Returns:
number of good peers.

contentManager

public void contentManager(PeerContentManager manager)
Set the peer content manager

Parameters:
manager - the peer content manager.

collective

public void collective(java.util.Vector peers,
                       int collective,
                       int type)
Create a collective.

Parameters:
peers - Vector of peerIDs who will be in the collective
collective - The type of collective to create.
type - The type of trust value configuration.

Query Cycle Simulator HEADER