|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttrust_system_lib.EigenTM
public class EigenTM
The EigenTM class conforms to the TrustAlg interface and implements the EigenTrust algorithm as described by Hector Garcia-molina, et. al.
Field Summary | |
---|---|
private double |
ALPHA
Weighting constant making pre-trusted peers more powerful |
private double |
EPSILON
Acceptable error margin in convergence tests. |
private double[][] |
normalized
Matrix storing persistent normalized (pre-multiplication) values. |
protected Network |
nw
The Network which this EigenTM is managing. |
private double[] |
pretrust
Pre-trusted peer distribution and weighting vector |
private double[] |
vectorA
Scratch space vector for multiplication purposes. |
private double[] |
vectorB
Scratch space vector for multiplication purposes. |
Constructor Summary | |
---|---|
EigenTM(Network nw)
Construct an EigenTM object. |
Method Summary | |
---|---|
java.lang.String |
algName()
Interfaced: Text name of this trust algorithm (spaces are okay). |
private int |
calcGlobalFBackInt(Relation rel)
Calculate a 'feedback integer' using global feedback data. |
void |
computeTrust(int user,
int cycle)
Interfaced: Compute trust, exporting trust values to Network. |
private double[] |
constantVectorMult(double constant,
double[] vector)
Linear Algebra: Constant-vector multiplication. |
java.lang.String |
fileExtension()
Interfaced: File extension placed on output files using this algorithm. |
protected boolean |
hasConverged(double[] vec1,
double[] vec2)
Test if the difference between two vectors is below some threshold. |
private void |
normalizeVector(int new_vec)
Normalize a single vector of the persistent matrix. |
private double[] |
singleMultiply(double[] prev_vector)
Perform a single multiplication iteration per EigenTrust specification. |
protected double[] |
trustMultiply(int user,
int max_iters)
Perform matrix multiply as a means of aggregating global trust data. |
void |
update(Transaction trans)
Interfaced: Given coordinates of a feedback commitment, update as needed. |
private double[] |
vectorAdd(double[] vector1,
double[] vector2)
Linear Algebra: Vector-vector addition. |
private double[] |
vectorMatrixMult(double[] vector,
double[][] matrix)
Linear Algebra: Vector-matrix multiplication. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Network nw
private final double ALPHA
private final double EPSILON
private double[] pretrust
private double[] vectorA
private double[] vectorB
private double[][] normalized
Constructor Detail |
---|
public EigenTM(Network nw)
nw
- Network which this EigenTM will be managingMethod Detail |
---|
public java.lang.String algName()
algName
in interface TrustAlg
public java.lang.String fileExtension()
fileExtension
in interface TrustAlg
public void update(Transaction trans)
update
in interface TrustAlg
trans
- Transaction detailing feedback commitmentpublic void computeTrust(int user, int cycle)
computeTrust
in interface TrustAlg
user
- Identifier of user performing trust computationcycle
- The current cycleprotected double[] trustMultiply(int user, int max_iters)
user
- Identifier of user performing trust computationmax_iters
- Maximum number of multiplications to perform
protected boolean hasConverged(double[] vec1, double[] vec2)
vec1
- The first vector for comparisonvec2
- The second vector for comparison
private void normalizeVector(int new_vec)
new_vec
- The vector to be normalizedprivate int calcGlobalFBackInt(Relation rel)
rel
- Relation whose 'feedback integer' needs calculated
private double[] singleMultiply(double[] prev_vector)
prev_vector
- Result of the last multiplication iteration
private double[] vectorMatrixMult(double[] vector, double[][] matrix)
vector
- Vector to be multipliedmatrix
- Matrix to be multiplied
private double[] constantVectorMult(double constant, double[] vector)
constant
- Constant to be multipliedvector
- Vector to be multiplied
private double[] vectorAdd(double[] vector1, double[] vector2)
vector1
- First vector to be addedvector2
- Second vector to be added
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |