|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectes.ants.felixgm.trmsim_wsn.trm.TRModel_WSN
es.ants.felixgm.trmsim_wsn.trm.eigentrust.EigenTrust
public class EigenTrust
This class models EigenTrust algorithm used by a client in a P2P, Ad-hoc or Wireless Sensor Network, in order to find the most trustworthy server offering a desired service.
It needs some parameters to be passed as a
EigenTrust_Parameters object. To do this, a file can be given following the next structure:
####################################
# EigenTrust parameters file
####################################
windowSize=5
epsilon=0.1
preTrustedPeersPercentage=0.3
preTrustedPeersWeight=0.25
zeroTrustNodeSelectionProbability=0.2
This file can be downloaded
here.
But if any of the parameters can not be successfully extracted from the file, they are set
to a default value.
| Field Summary | |
|---|---|
protected double |
MAX_SATISFACTION
Maximum satisfaction value: 1.0 |
protected double |
MIN_SATISFACTION
Minimum satisfaction value: -1.0 |
| Fields inherited from class es.ants.felixgm.trmsim_wsn.trm.TRModel_WSN |
|---|
trmParameters |
| Constructor Summary | |
|---|---|
EigenTrust(EigenTrust_Parameters eigenTrust_parameters)
Class EigenTrust constructor |
|
| Method Summary | |
|---|---|
GatheredInformation |
gatherInformation(Sensor client,
Service service)
This method collects or gathers the required information from the network needed to evaluate each sensor offering a given service in order to determine whether to have a transaction with it or not |
Network |
generateRandomNetwork(int numSensors,
double probClients,
double rangeFactor,
java.util.Collection<java.lang.Double> probServices,
java.util.Collection<java.lang.Double> probGoodness,
java.util.Collection<Service> services)
This method generates a new random network specific for this trust and reputation model |
static java.lang.String |
get_name()
Returns the name of this model, i.e., "EigenTrust" |
Network |
loadCurrentNetwork(java.lang.String fileName)
This method loads a network from a XML file and creates the specific network corresponding to this trust and reputation model |
Outcome |
performTransaction(java.util.Vector<Sensor> path,
Service service)
This method actually requests a desired service to a specified server and evaluates the satisfaction of the client with the actually received service |
Outcome |
punish(java.util.Vector<Sensor> path,
Outcome outcome)
EigenTrust does not implement this method, since it does not apply any specific punish step |
Outcome |
reward(java.util.Vector<Sensor> path,
Outcome outcome)
EigenTrust does not implement this method, since it does not apply any specific reward step |
java.util.Vector<Sensor> |
scoreAndRanking(Sensor client,
GatheredInformation gi)
This method computes a trust and/or reputation value for each reachable server from the specified client and returns either a sorted list of all the reachable servers or a path leading directly to the most trustworthy and/or reputable one |
| Methods inherited from class es.ants.felixgm.trmsim_wsn.trm.TRModel_WSN |
|---|
get_TRMParameters, set_TRMParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final double MIN_SATISFACTION
protected final double MAX_SATISFACTION
| Constructor Detail |
|---|
public EigenTrust(EigenTrust_Parameters eigenTrust_parameters)
eigenTrust_parameters - Parameters needed for the algorithm, as described before| Method Detail |
|---|
public static java.lang.String get_name()
public GatheredInformation gatherInformation(Sensor client,
Service service)
TRModel_WSN
gatherInformation in class TRModel_WSNclient - The client applying this trust and reputation model in order to
find the most trustworthy and reputable server offering a given serviceservice - The service requested by the given client
public java.util.Vector<Sensor> scoreAndRanking(Sensor client,
GatheredInformation gi)
TRModel_WSN
scoreAndRanking in class TRModel_WSNclient - The client applying this trust and reputation model in order to
find the most trustworthy and reputable server offering a given servicegi - The gathered information fro the network needed in order to compute
the trust and/or reputation value for each reachable server
public Outcome performTransaction(java.util.Vector<Sensor> path,
Service service)
TRModel_WSN
performTransaction in class TRModel_WSNpath - Path of sensors leading to the most trustworthy and reputable server
or sorted list of all the reachable serversservice - Service requested by the client running this trust and reputation model
public Outcome reward(java.util.Vector<Sensor> path,
Outcome outcome)
reward in class TRModel_WSNpath - outcome -
public Outcome punish(java.util.Vector<Sensor> path,
Outcome outcome)
punish in class TRModel_WSNpath - outcome -
public Network generateRandomNetwork(int numSensors,
double probClients,
double rangeFactor,
java.util.Collection<java.lang.Double> probServices,
java.util.Collection<java.lang.Double> probGoodness,
java.util.Collection<Service> services)
TRModel_WSN
generateRandomNetwork in class TRModel_WSNnumSensors - Number of sensors composing the networkprobClients - Probability of a sensor to act as a client requesting servicesrangeFactor - Maximum wireless range of every sensor. It determines the neighborhood of every sensorprobServices - A collection of probabilities of offering a certain service, one per serviceprobGoodness - A collection of goodnesses about offering a certain service, one per serviceservices - All the services offered by the generated Network
public Network loadCurrentNetwork(java.lang.String fileName)
throws java.lang.Exception
TRModel_WSN
loadCurrentNetwork in class TRModel_WSNfileName - Path of the XML to load the network from
java.lang.Exception - If the XML file given does not have the appropriate structure, or if
a sensor links to an undefined sensor, or if a sensor links to itself
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||