|
Query Cycle Simulator HEADER | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Represents a peer's behavior during a simulation. The peer will use an object of this type to make decisions regarding its behavior.
| Field Summary | |
static int |
ACTIVITY_ALWAYSUP
|
static int |
ACTIVITY_ALWAYSUPNOQUERIES
|
static int |
ACTIVITY_RANDOM
|
static int |
GOOD_PEER
|
static int |
HIGHLY_TRUSTED_PEER
|
static int |
MALICIOUS_CAMOUFLAGED
|
static int |
MALICIOUS_COLLECTIVE
|
static int |
MALICIOUS_PEER
|
static int |
MALICIOUS_SPY
|
static int |
RPB_RANDOM
|
static int |
RPB_SIMPLEPROBABILISTIC
|
static int |
RPB_TRUSTDETERMINISTIC
|
static int |
RPB_TRUSTPROBABILISTIC
|
| Method Summary | |
void |
activity(int activity)
Initializes uptime ratio and query activity ratio for all specified peers. |
int |
categoryPreference()
Get the peers category preference. |
void |
categoryPreference(int preference)
Indicates which category of files a peer is likely to respond to. |
void |
errorFraction(double errorFraction)
The fraction of uploads that will contain errors. |
double |
opinion(Peer peer,
boolean authenticFile)
Will determine the value a peer should use to update it's local trust |
double |
queryActivity()
The fraction of cycles this peer will participate by sending to queries. |
boolean |
respond(PeerMsgQuery msg)
Will determine if peer should respond to a query |
int |
responseSelector()
This determines how a peer will choose a site to download from. |
void |
responseSelector(int selector)
Set the selector for how a peer will choose a download site. |
int |
type()
The type of peer. |
void |
type(int type)
Set the type of peer. |
double |
uploadStatus(Peer dest)
Will determine the file upload status. |
| Field Detail |
public static final int GOOD_PEER
public static final int HIGHLY_TRUSTED_PEER
public static final int MALICIOUS_PEER
public static final int MALICIOUS_COLLECTIVE
public static final int MALICIOUS_CAMOUFLAGED
public static final int MALICIOUS_SPY
public static final int ACTIVITY_ALWAYSUP
public static final int ACTIVITY_RANDOM
public static final int ACTIVITY_ALWAYSUPNOQUERIES
public static final int RPB_RANDOM
public static final int RPB_TRUSTDETERMINISTIC
public static final int RPB_TRUSTPROBABILISTIC
public static final int RPB_SIMPLEPROBABILISTIC
| Method Detail |
public double queryActivity()
public int type()
public void type(int type)
public void errorFraction(double errorFraction)
errorFraction - fraction of file upload errors.public void categoryPreference(int preference)
public int categoryPreference()
public int responseSelector()
public void responseSelector(int selector)
selector - typepublic boolean respond(PeerMsgQuery msg)
msg - The query messagepublic double uploadStatus(Peer dest)
dest - The destination peer.
public double opinion(Peer peer,
boolean authenticFile)
peer - the peer that was downloaded from.authenticFile - true if the file download successful.public void activity(int activity)
|
Query Cycle Simulator HEADER | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||