es.ants.felixgm.trmsim_wsn.outcomes
Class EnergyConsumptionOutcome

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

public class EnergyConsumptionOutcome
extends BasicOutcome

This class models the outcome of a trust and reputation model. It includes, besides the elements of a BasicOutcome, the energy consumption of each sensor (clients, benevolent servers, malicious servers and relay servers) of a network

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

Field Summary
protected  double avgSensorEnergyConsumption
          Average energy consumption per sensor and per each execution of the trust model
protected  double benevolentServerEnergyConsumption
          Energy consumption per benevolent server and per each execution of the trust model
protected  double clientEnergyConsumption
          Energy consumption per client and per each execution of the trust model
protected  double maliciousServerEnergyConsumption
          Energy consumption per malicious server and per each execution of the trust model
protected  double relayServerEnergyConsumption
          Energy consumption per relay server and per each execution of the trust model
 
Fields inherited from class es.ants.felixgm.trmsim_wsn.outcomes.BasicOutcome
avgPathLength, avgSatisfaction
 
Fields inherited from class es.ants.felixgm.trmsim_wsn.outcomes.Outcome
satisfaction
 
Constructor Summary
  EnergyConsumptionOutcome(Satisfaction satisfaction, double avgPathLength)
          Class EnergyConsumptionOutcome constructor
protected EnergyConsumptionOutcome(Satisfaction satisfaction, double avgSatisfaction, double avgPathLength, double clientEnergyConsumption, double maliciousServerEnergyConsumption, double benevolentServerEnergyConsumption, double relayServerEnergyConsumption)
          Class EnergyConsumptionOutcome constructor
 
Method Summary
 Outcome aggregate(java.util.Collection<Outcome> outcomes)
          This method computes the average of all the given outcomes
 double get_avgSensorEnergyConsumption()
          This method returns the average energy consumption per sensor and per each execution of the trust model of this outcome
 double get_benevolentServerEnergyConsumption()
          This method returns the energy consumption per benevolent server and per each execution of the trust model of this outcome
 double get_clientEnergyConsumption()
          This method returns the energy consumption per client and per each execution of the trust model of this outcome
 double get_maliciousServerEnergyConsumption()
          This method returns the energy consumption per malicious server and per each execution of the trust model of this outcome
 double get_relayServerEnergyConsumption()
          This method returns the energy consumption per relay server and per each execution of the trust model of this outcome
protected  java.lang.String getOutcomesFileLine()
          This method returns the line of the file where to save this outcome, including all its elements
 void setEnergyConsumption(Network network, Service requiredService, int numExecutions)
          This method sets the energy consumption of the sensors of a given network in this outcome
 java.lang.String toString()
           
 
Methods inherited from class es.ants.felixgm.trmsim_wsn.outcomes.BasicOutcome
get_avgPathLength, get_avgSatisfaction
 
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

clientEnergyConsumption

protected double clientEnergyConsumption
Energy consumption per client and per each execution of the trust model


maliciousServerEnergyConsumption

protected double maliciousServerEnergyConsumption
Energy consumption per malicious server and per each execution of the trust model


benevolentServerEnergyConsumption

protected double benevolentServerEnergyConsumption
Energy consumption per benevolent server and per each execution of the trust model


relayServerEnergyConsumption

protected double relayServerEnergyConsumption
Energy consumption per relay server and per each execution of the trust model


avgSensorEnergyConsumption

protected double avgSensorEnergyConsumption
Average energy consumption per sensor and per each execution of the trust model

Constructor Detail

EnergyConsumptionOutcome

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

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

EnergyConsumptionOutcome

protected EnergyConsumptionOutcome(Satisfaction satisfaction,
                                   double avgSatisfaction,
                                   double avgPathLength,
                                   double clientEnergyConsumption,
                                   double maliciousServerEnergyConsumption,
                                   double benevolentServerEnergyConsumption,
                                   double relayServerEnergyConsumption)
Class EnergyConsumptionOutcome constructor

Parameters:
satisfaction - Clients satisfaction
avgSatisfaction - Average satisfaction of the client with the received service
avgPathLength - Average length of all the paths found
clientEnergyConsumption - Energy consumption per client and per each execution of the trust model
maliciousServerEnergyConsumption - Energy consumption per malicious server and per each execution of the trust model
benevolentServerEnergyConsumption - Energy consumption per benevolent server and per each execution of the trust model
relayServerEnergyConsumption - Energy consumption per relay server and per each execution of the trust model
Method Detail

setEnergyConsumption

public void setEnergyConsumption(Network network,
                                 Service requiredService,
                                 int numExecutions)
This method sets the energy consumption of the sensors of a given network in this outcome

Parameters:
network - Network whose sensors energy consumption is to be set in this outcome
requiredService - Service requested by every client in the network
numExecutions - Number of times the selected trust and reputation model has been executed

aggregate

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

Overrides:
aggregate in class BasicOutcome
Parameters:
outcomes - Outcomes to be aggregated
Returns:
The aggregation of the given outcomes

get_clientEnergyConsumption

public double get_clientEnergyConsumption()
This method returns the energy consumption per client and per each execution of the trust model of this outcome

Returns:
The energy consumption per client and per each execution of the trust model of this outcome

get_maliciousServerEnergyConsumption

public double get_maliciousServerEnergyConsumption()
This method returns the energy consumption per malicious server and per each execution of the trust model of this outcome

Returns:
The energy consumption per malicious server and per each execution of the trust model of this outcome

get_benevolentServerEnergyConsumption

public double get_benevolentServerEnergyConsumption()
This method returns the energy consumption per benevolent server and per each execution of the trust model of this outcome

Returns:
The energy consumption per benevolent server and per each execution of the trust model of this outcome

get_relayServerEnergyConsumption

public double get_relayServerEnergyConsumption()
This method returns the energy consumption per relay server and per each execution of the trust model of this outcome

Returns:
The energy consumption per relay server and per each execution of the trust model of this outcome

get_avgSensorEnergyConsumption

public double get_avgSensorEnergyConsumption()
This method returns the average energy consumption per sensor and per each execution of the trust model of this outcome

Returns:
The average energy consumption per sensor and per each execution of the trust model of this outcome

toString

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

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 BasicOutcome
Returns:
The line of the file where to save this outcome, including all its elements