es.ants.felixgm.trmsim_wsn.outcomes
Class BasicOutcome

java.lang.Object
  extended by es.ants.felixgm.trmsim_wsn.outcomes.Outcome
      extended by es.ants.felixgm.trmsim_wsn.outcomes.BasicOutcome
Direct Known Subclasses:
EnergyConsumptionOutcome

public class BasicOutcome
extends Outcome

This class models the outcome of a trust and reputation model. It includes the path leading to the most trustworthy and/or reputable server found as well as the satisfaction perceived by the client

Since:
0.4
Version:
0.4
Author:
Félix Gómez Mármol, Gregorio Martínez Pérez

Field Summary
protected  double avgPathLength
          Average length of all the paths found
protected  double avgSatisfaction
          Average satisfaction of the client with the received service
 
Fields inherited from class es.ants.felixgm.trmsim_wsn.outcomes.Outcome
satisfaction
 
Constructor Summary
  BasicOutcome(Satisfaction satisfaction, double avgPathLength)
          Class BasicOutcome constructor
protected BasicOutcome(Satisfaction satisfaction, double avgSatisfaction, double avgPathLength)
          Class BasicOutcome constructor
 
Method Summary
 Outcome aggregate(java.util.Collection<Outcome> outcomes)
          This method computes the average of all the given outcomes
 double get_avgPathLength()
          This method returns the average length of all the paths found
 double get_avgSatisfaction()
          This method returns the average satisfaction of the client with the received service
protected  java.lang.String getOutcomesFileLine()
          This method returns the line of the file where to save this outcome, including all its elements
 java.lang.String toString()
           
 
Methods inherited from class es.ants.felixgm.trmsim_wsn.outcomes.Outcome
computeOutcomes, computeOutcomes, get_satisfaction, writeToFile, writeToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

avgSatisfaction

protected double avgSatisfaction
Average satisfaction of the client with the received service


avgPathLength

protected double avgPathLength
Average length of all the paths found

Constructor Detail

BasicOutcome

public BasicOutcome(Satisfaction satisfaction,
                    double avgPathLength)
Class BasicOutcome constructor

Parameters:
satisfaction - Clients satisfaction
avgPathLength - Average length of all the paths found

BasicOutcome

protected BasicOutcome(Satisfaction satisfaction,
                       double avgSatisfaction,
                       double avgPathLength)
Class BasicOutcome constructor

Parameters:
satisfaction - Clients satisfaction
avgSatisfaction - Average satisfaction of the client with the received service
avgPathLength - Average length of all the paths found
Method Detail

aggregate

public Outcome aggregate(java.util.Collection<Outcome> outcomes)
Description copied from class: Outcome
This method computes the average of all the given outcomes

Specified by:
aggregate in class Outcome
Parameters:
outcomes - Outcomes to be aggregated
Returns:
The aggregation of the given outcomes

get_avgSatisfaction

public double get_avgSatisfaction()
This method returns the average satisfaction of the client with the received service

Returns:
The average satisfaction of the client with the received service

get_avgPathLength

public double get_avgPathLength()
This method returns the average length of all the paths found

Returns:
The average length of all the paths found

toString

public java.lang.String toString()
Overrides:
toString in class Outcome

getOutcomesFileLine

protected java.lang.String getOutcomesFileLine()
Description copied from class: Outcome
This method returns the line of the file where to save this outcome, including all its elements

Overrides:
getOutcomesFileLine in class Outcome
Returns:
The line of the file where to save this outcome, including all its elements