|
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.PeerBehaviorImpl
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 | |
(package private) static int |
ACTIVE
|
(package private) static int |
ACTIVITY_ALWAYSUP
|
(package private) static int |
ACTIVITY_ALWAYSUPNOQUERIES
|
(package private) static int |
ACTIVITY_RANDOM
|
(package private) static int |
BOTTOM_CATEGORY
|
(package private) static int |
GOOD_PEER
|
(package private) static int |
HIGHLY_TRUSTED_PEER
|
(package private) static int |
INACTIVE
|
(package private) static int |
MALICIOUS_CAMOUFLAGED
|
(package private) static int |
MALICIOUS_COLLECTIVE
|
(package private) static int |
MALICIOUS_PEER
|
(package private) static int |
MALICIOUS_SPY
|
(package private) static int |
MAX_TTL
|
(package private) static int |
MED_TTL
|
(package private) static int |
MIN_TTL
|
(package private) static int |
RANDOM_CATEGORY
|
(package private) static int |
RPB_RANDOM
|
(package private) static int |
RPB_SIMPLEPROBABILISTIC
|
(package private) static int |
RPB_TRUSTDETERMINISTIC
|
(package private) static int |
RPB_TRUSTPROBABILISTIC
|
(package private) static int |
TOP_CATEGORY
|
| Constructor Summary | |
PeerBehaviorImpl(Peer peer,
int type)
Constructor |
|
| 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
static final int GOOD_PEER
static final int HIGHLY_TRUSTED_PEER
static final int MALICIOUS_PEER
static final int MALICIOUS_COLLECTIVE
static final int MALICIOUS_CAMOUFLAGED
static final int MALICIOUS_SPY
static final int INACTIVE
static final int ACTIVE
static final int ACTIVITY_ALWAYSUP
static final int ACTIVITY_RANDOM
static final int ACTIVITY_ALWAYSUPNOQUERIES
static final int MIN_TTL
static final int MED_TTL
static final int MAX_TTL
static final int TOP_CATEGORY
static final int BOTTOM_CATEGORY
static final int RANDOM_CATEGORY
static final int RPB_RANDOM
static final int RPB_TRUSTDETERMINISTIC
static final int RPB_TRUSTPROBABILISTIC
static final int RPB_SIMPLEPROBABILISTIC
| Constructor Detail |
public PeerBehaviorImpl(Peer peer,
int type)
| Method Detail |
public double queryActivity()
PeerBehavior
queryActivity in interface PeerBehaviorpublic int type()
PeerBehavior
type in interface PeerBehaviorpublic void type(int type)
PeerBehavior
type in interface PeerBehaviorpublic void errorFraction(double errorFraction)
PeerBehavior
errorFraction in interface PeerBehaviorerrorFraction - fraction of file upload errors.public int categoryPreference()
PeerBehavior
categoryPreference in interface PeerBehaviorpublic void categoryPreference(int preference)
PeerBehavior
categoryPreference in interface PeerBehaviorpublic int responseSelector()
PeerBehavior
responseSelector in interface PeerBehaviorpublic void responseSelector(int selector)
PeerBehavior
responseSelector in interface PeerBehaviorselector - typepublic boolean respond(PeerMsgQuery msg)
respond in interface PeerBehaviormsg - The query messagepublic double uploadStatus(Peer dest)
uploadStatus in interface PeerBehaviordest - The destination peer.
public double opinion(Peer peer,
boolean authenticFile)
opinion in interface PeerBehaviorpeer - the peer that was downloaded from.authenticFile - true if the file download successful.public void activity(int activity)
activity in interface PeerBehavior
|
Query Cycle Simulator HEADER | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||