|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectes.ants.felixgm.trmsim_wsn.network.Sensor
es.ants.felixgm.trmsim_wsn.trm.eigentrust.EigenTrust_Sensor
public class EigenTrust_Sensor
This class models a Sensor implementing EigenTrust
| Field Summary | |
|---|---|
protected static int |
_numSensors
Number of sensors composing the network this sensor belongs to |
protected static double[] |
_preTrustedPeersVector
Vector p |
protected static int |
_windowSize
Window size for storing transactions outcomes |
protected double[] |
globalTrustVector
Vector t |
protected java.util.Collection<EigenTrust_Sensor> |
interactedServers
Collection of severs who this sensor has interacted with |
protected boolean |
isPreTrustedPeer
Indicates if this sensor is a pre-trusted peer (true) or not (false) |
protected java.util.Collection<Transaction> |
transactions
Collection of Transactions this sensor has had |
| Fields inherited from class es.ants.felixgm.trmsim_wsn.network.Sensor |
|---|
_maxDistance, activeState, collusion, dynamic, id, idCount, links, numRequests, numRequestsThreshold, numRequestsTimer, outcome, requiredService, runningSimulation, servicesGoodness, sleepTimer, sleepTimerAux, transmittedDistance, trmmodelWSN, xPosition, yPosition |
| Constructor Summary | |
|---|---|
EigenTrust_Sensor()
This constructor creates a new Sensor implementing EigenTrust |
|
EigenTrust_Sensor(int id,
double x,
double y)
This constructor creates a new Sensor implementing EigenTrust |
|
| Method Summary | |
|---|---|
void |
addNewTransaction(EigenTrust_Sensor client,
EigenTrust_Sensor server,
Outcome outcome)
This method adds a new Transaction to the collection of transactions of this sensor |
double[] |
get_globalTrustVector()
Returns the current global trust vector t_i^k |
static double[] |
get_preTrustedPeersVector()
Returns the current pre-trusted peers vector p |
double |
getNormalizedLocalTrustValue(EigenTrust_Sensor server)
This method computes the normalized local trust value c_{ij}\in[0,1] |
static int |
getNumSensors()
Returns the number of sensors composing the network this sensor belongs to |
boolean |
isPreTrustedPeer()
Indicates if this sensor is a pre-trusted peer (true) or not (false) |
void |
reset()
This method resets a Sensor to its initial state |
void |
set_globalTrustVector(double[] globalTrustVector)
Sets the new global trust vector t_i^{k+1} |
static void |
set_preTrustedPeersVector(double[] preTrustedPeersVector)
Sets the new pre-trusted peers vector p |
static void |
set_windowSize(int windowSize)
Sets the window size for storing transactions outcomes |
static void |
setNumSensors(int numSensors)
Sets the number of sensors composing the network this sensor belongs to |
void |
setPreTrustedPeer(boolean isPreTrustedPeer)
Sets this senor as a pre-trusted peer or not |
| Methods inherited from class es.ants.felixgm.trmsim_wsn.network.Sensor |
|---|
addLink, addService, addTransmittedDistance, cancelAllTimers, distance, distanceInHops, equals, findSensors, get_goodness, get_numServices, get_outcome, get_requiredService, get_services, get_transmittedDistance, get_TRModel_WSN, getNeighbors, getService, getX, getY, id, isActive, isNeighbor, isRunningSimulation, offersService, offersService, removeAllNeighbors, removeLink, removeService, resetId, run, serve, set_goodness, set_requiredService, set_TRModel_WSN, setActiveState, setCollusion, setDynamic, setMaxDistance, setRunningSimulation, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static int _numSensors
protected static int _windowSize
protected java.util.Collection<Transaction> transactions
protected double[] globalTrustVector
protected static double[] _preTrustedPeersVector
protected java.util.Collection<EigenTrust_Sensor> interactedServers
protected boolean isPreTrustedPeer
| Constructor Detail |
|---|
public EigenTrust_Sensor()
public EigenTrust_Sensor(int id,
double x,
double y)
id - Identifier of the new sensorx - X coordinate of the new sensory - Y coordinate of the new sensor| Method Detail |
|---|
public double getNormalizedLocalTrustValue(EigenTrust_Sensor server)
server - Server j
public void addNewTransaction(EigenTrust_Sensor client,
EigenTrust_Sensor server,
Outcome outcome)
client - The client who requested the serviceserver - The server who provided the serviceoutcome - Outcome of the trnsaction to be addedpublic void reset()
Sensor
reset in class Sensorpublic void set_globalTrustVector(double[] globalTrustVector)
globalTrustVector - New global trust vector t_i^{k+1}public double[] get_globalTrustVector()
public static void set_preTrustedPeersVector(double[] preTrustedPeersVector)
preTrustedPeersVector - New pre-trusted peers vector ppublic static double[] get_preTrustedPeersVector()
public static int getNumSensors()
public boolean isPreTrustedPeer()
public static void setNumSensors(int numSensors)
numSensors - The number of sensors composing the network this sensor belongs topublic static void set_windowSize(int windowSize)
windowSize - New window size for storing transactions outcomespublic void setPreTrustedPeer(boolean isPreTrustedPeer)
isPreTrustedPeer - true if this sensor is to be a pre-trusted peer, false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||