|
Query Cycle Simulator HEADER | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--qcsim.peer.impl.PeerImpl
This object contains all information associated with a peer in the network.
| Constructor Summary | |
PeerImpl(int debug,
PeerManager manager,
int peerID,
int behavior,
NetworkSimulator network)
Constructor. |
|
PeerImpl(PeerManager manager,
int peerID,
int behavior,
NetworkSimulator network)
Constructor. |
|
| Method Summary | |
boolean |
addNeighbor(Peer peer)
Add neighbor peer. |
PeerBehavior |
behavior()
Get peer's behavior for a given scenario |
void |
collectiveNeighbor(int peerID)
This method adds the peerID to its list of known peers in a malicious collective. |
PeerContent |
content()
get peer content category |
void |
content(PeerContent content)
Set peer content category |
int |
cycle()
Get the current cycle from the manager. |
PeerDescription |
description()
Get a description of the peer. |
java.lang.String |
dumpIntVector(java.util.Vector v)
|
java.util.Map |
localTrust()
The peer's local trust |
PeerManager |
manager()
The peer's manager |
void |
message(PeerMessage msg)
Dispatches message to associated message handler. |
Peer |
neighbor(int i)
The ith neighbor of this peer |
int |
neighbors()
The number of neighbors |
int |
peerID()
get peer ID |
void |
removeFromNetwork()
|
void |
removeNeighbor(Peer peer)
Remove neighbor peer. |
double |
rpc(PeerRPC cmd)
Handle a remote procedure call to a peer. |
Notifiee |
simulatorCallback()
Get the callback interface used by the simulator to inform the peer with Simulator Notifications. |
double |
trust()
A peer's global trust value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PeerImpl(PeerManager manager,
int peerID,
int behavior,
NetworkSimulator network)
manager - The manager that created this peer.peerID - peer IDbehavior - The peer's behavior.network - The network used to send and receive messages.
public PeerImpl(int debug,
PeerManager manager,
int peerID,
int behavior,
NetworkSimulator network)
manager - The manager that created this peer.peerID - peer IDbehavior - The peer's behavior.network - The network used to send and receive messages.| Method Detail |
public PeerDescription description()
Peer
description in interface Peerpublic Notifiee simulatorCallback()
public int peerID()
peerID in interface Peerpublic double trust()
public java.util.Map localTrust()
public void message(PeerMessage msg)
message in interface Peermsg - message receivedpublic void collectiveNeighbor(int peerID)
peerID - The id of the peer to add.public int neighbors()
neighbors in interface Peerpublic Peer neighbor(int i)
neighbor in interface Peerpublic boolean addNeighbor(Peer peer)
addNeighbor in interface Peerpeer - neighbor peer to be added
public void removeNeighbor(Peer peer)
removeNeighbor in interface Peerpeer - neighbor peer to be removed
public void content(PeerContent content)
content - the contentpublic PeerContent content()
content in interface Peerpublic PeerBehavior behavior()
behavior in interface Peerpublic PeerManager manager()
Peer
manager in interface Peerpublic int cycle()
public double rpc(PeerRPC cmd)
rpc in interface Peercmd - The rpc command
public java.lang.String dumpIntVector(java.util.Vector v)
public void removeFromNetwork()
|
Query Cycle Simulator HEADER | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||