|
||||||||||
| 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.peertrust.PeerTrust_Sensor
public class PeerTrust_Sensor
This class models a Sensor implementing PeerTrust
| Field Summary | |
|---|---|
protected static int |
_windowSize
Window size for storing transactions outcomes |
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 | |
|---|---|
PeerTrust_Sensor()
This constructor creates a new Sensor implementing PeerTrust |
|
PeerTrust_Sensor(int id,
double x,
double y)
This constructor creates a new Sensor implementing PeerTrust |
|
| Method Summary | |
|---|---|
void |
addNewTransaction(PeerTrust_Sensor client,
PeerTrust_Sensor server,
Outcome outcome)
This method adds a new Transaction to the collection of transactions of this sensor |
static boolean |
collusion()
Indicates if ther is a collusion or not |
Service |
get_requiredService()
Returns the service requested by the client |
int |
getNumTransactions()
Returns the number of Transactions this sensor has had |
java.util.Collection<Transaction> |
getTransactions()
This method gets the collection of Transactions this sensor has had |
void |
reset()
This method resets a Sensor to its initial state |
static void |
set_windowSize(int windowSize)
Sets the window size for storing transactions outcomes |
| 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_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 _windowSize
protected java.util.Collection<Transaction> transactions
| Constructor Detail |
|---|
public PeerTrust_Sensor()
public PeerTrust_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 void addNewTransaction(PeerTrust_Sensor client,
PeerTrust_Sensor server,
Outcome outcome)
client - The client who requested the serviceserver - The server who provided the serviceoutcome - Outcome of the trnsaction to be addedpublic java.util.Collection<Transaction> getTransactions()
public int getNumTransactions()
public void reset()
Sensor
reset in class Sensorpublic static boolean collusion()
public Service get_requiredService()
get_requiredService in class Sensorpublic static void set_windowSize(int windowSize)
windowSize - New window size for storing transactions outcomes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||