trust_system_lib
Class Opinion

java.lang.Object
  extended by trust_system_lib.Opinion
All Implemented Interfaces:
java.lang.Comparable<Opinion>

public class Opinion
extends java.lang.Object
implements java.lang.Comparable<Opinion>

The Opinion class implements Subjective Logic opinions.


Field Summary
private  double a
          Base-rate field.
private  double b
          Belief field.
private  double d
          Disbelief field.
private  double u
          Uncertainty field.
 
Constructor Summary
Opinion(double b, double d, double u, double a)
          Construct an Opinion by passing all field values.
 
Method Summary
 Opinion clone()
          Create a duplicate of this Opinion object.
 int compareTo(Opinion that)
          Compare this Opinion to another Opinion object.
 Opinion consensus(Opinion that)
          The consensus operator used in the 'fusion' of two Opinions.
 Opinion discount(Opinion that)
          The discount operator used in the analysis of transitive chains.
 void edit(int pos_fbacks, int neg_fbacks)
          Update an Opinion using feedback data.
 double expectedValue()
          Calculate the expected value of this Opinion.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

b

private double b
Belief field.


d

private double d
Disbelief field.


u

private double u
Uncertainty field.


a

private double a
Base-rate field. For a-priori notions of trust.

Constructor Detail

Opinion

public Opinion(double b,
               double d,
               double u,
               double a)
Construct an Opinion by passing all field values.

Parameters:
b - Belief
d - Disbelief
u - Uncertainty
a - Base-rate
Method Detail

edit

public void edit(int pos_fbacks,
                 int neg_fbacks)
Update an Opinion using feedback data.

Parameters:
pos_fbacks - Number of positive feedbacks
neg_fbacks - Number of negative feedbacks

expectedValue

public double expectedValue()
Calculate the expected value of this Opinion.

Returns:
The expected value of this Opinion

discount

public Opinion discount(Opinion that)
The discount operator used in the analysis of transitive chains.

Parameters:
that - Second Opinion in 'this -> that' chain. Order matters!
Returns:
The discounted Opinion.

consensus

public Opinion consensus(Opinion that)
The consensus operator used in the 'fusion' of two Opinions.

Parameters:
that - The second Opinion being averaged with 'this' one.
Returns:
The fused Opinion.

compareTo

public int compareTo(Opinion that)
Compare this Opinion to another Opinion object. Comparisons are made on the basis of confidence=(1-uncertainty). Ties are broken by belief.

Specified by:
compareTo in interface java.lang.Comparable<Opinion>
Parameters:
that - The other Opinion being compared to 'this' one
Returns:
1 if this > that, 0 if this == that, -1 otherwise

clone

public Opinion clone()
Create a duplicate of this Opinion object.

Overrides:
clone in class java.lang.Object
Returns:
a duplicate of this Opinion object