core_lib
Class Relation

java.lang.Object
  extended by core_lib.Relation

public class Relation
extends java.lang.Object

The Relation class describes the prior interaction between two users. It stores both feedbacks and the critical trust value that is calculated by a trust management system (via TrustAlg interface).


Nested Class Summary
static class Relation.Copy
          The Copy enumeration differentiates between the different feedback histories which are being stored at the Relation level.
 
Field Summary
private  int global_neg
          The number of globally broadcast negative/unsatisfactory feedbacks.
private  int global_pos
          The number of globally broadcast positive/satisfactory feedbacks.
private  Relation.Copy history
          Describes feedback history currently activated on this Relation
private  int honest_neg
          The number of truly negative/unsatisfactory interactions.
private  int honest_pos
          The number of truly positive/satisfactory interactions.
private  double trust_val
          The trust value characterizing this user relationship.
 
Constructor Summary
Relation()
          Construct an empty Relation object.
 
Method Summary
 int getNeg()
          Access method to number of negative feedbacks, per 'history' parameter.
 int getPos()
          Access method to number of positive feedbacks, per 'history' parameter.
 double getTrust()
          Access method to the trust value.
 void incGlobalNeg()
          Increment the global-negative feedback count by one
 void incGlobalPos()
          Increment the global-positive feedback count by one
 void incHonestNeg()
          Increment the actual negative interaction count by one
 void incHonestPos()
          Increment the actual positive interaction count by one
 void setHistory(Relation.Copy historyStyle)
          Set the history store activated for this Relation object.
 void setTrust(double new_trust)
          Set the trust_value field to a new value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

history

private Relation.Copy history
Describes feedback history currently activated on this Relation


global_pos

private int global_pos
The number of globally broadcast positive/satisfactory feedbacks.


global_neg

private int global_neg
The number of globally broadcast negative/unsatisfactory feedbacks.


honest_pos

private int honest_pos
The number of truly positive/satisfactory interactions.


honest_neg

private int honest_neg
The number of truly negative/unsatisfactory interactions.


trust_val

private double trust_val
The trust value characterizing this user relationship.

Constructor Detail

Relation

public Relation()
Construct an empty Relation object. Relations should be modified only according to the methods below, so no others are provided.

Method Detail

getTrust

public double getTrust()
Access method to the trust value.

Returns:
Trust value characterizing this user Relation

setTrust

public void setTrust(double new_trust)
Set the trust_value field to a new value.

Parameters:
new_trust - The new value for the trust_value field

setHistory

public void setHistory(Relation.Copy historyStyle)
Set the history store activated for this Relation object.

Parameters:
historyStyle - History to be maintained, per Copy enumeration

getPos

public int getPos()
Access method to number of positive feedbacks, per 'history' parameter.

Returns:
Global-positive feedbacks in this Relation

getNeg

public int getNeg()
Access method to number of negative feedbacks, per 'history' parameter.

Returns:
Global-negative feedbacks in this Relation

incGlobalPos

public void incGlobalPos()
Increment the global-positive feedback count by one


incGlobalNeg

public void incGlobalNeg()
Increment the global-negative feedback count by one


incHonestPos

public void incHonestPos()
Increment the actual positive interaction count by one


incHonestNeg

public void incHonestNeg()
Increment the actual negative interaction count by one