|
||||||||||
| 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.lftm.LFTM_Sensor
public class LFTM_Sensor
This class models a Sensor implementing LFTM
| Field Summary | |
|---|---|
protected static int |
_numServers
Number of servers composing the network this sensor belongs to |
protected java.util.HashMap<LFTM_Service,Variable> |
_servicesGoodness
Goodness of this sensor related to each provided service |
protected Variable |
clientConformity
Client's conformity, used to assess the client satisfaction with a received service |
protected Variable |
clientGoodness
Client's goodness, used to assess the level of punishment or reward to apply to a trustworthy or untrustworthy server |
protected double |
costWeight
Service's cost weight used when comparing two services |
protected double |
deliveryWeight
Service's delivery time weight used when comparing two services |
protected double |
priceWeight
Service's price weight used when comparing two services |
protected double |
qualityWeight
Service's quality weight used when comparing two services |
| 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 | |
|---|---|
LFTM_Sensor()
This constructor creates a new Sensor implementing LFTM |
|
LFTM_Sensor(int id,
double x,
double y)
This constructor creates a new Sensor implementing LFTM |
|
| Method Summary | |
|---|---|
void |
addLink(Sensor node)
Adds a link to a given sensor |
void |
addService(Service service,
double goodness)
Adds a new service to the set of offered services of this sensor |
Variable |
evaluateSatisfaction(Variable servicesComparison)
This method evaluates the client satisfaction with the received service using both the comparison between the expected service and the actually received one, and the client's conformity |
Variable |
get_clientGoodness()
This method returns this client's goodness |
double |
get_costWeight()
This method returns the service's cost weight used when comparing two services |
double |
get_deliveryWeight()
This method returns the service's delivery time weight used when comparing two services |
double |
get_goodness(Service service)
Gets the goodness of a given service |
int |
get_numServers()
Returns the number of servers of the network |
double |
get_priceWeight()
This method returns the service's price weight used when comparing two services |
double |
get_qualityWeight()
This method returns the service's quality weight used when comparing two services |
double |
getHeuristic(Sensor sensor)
Gets the heuristic value with a given neighbor |
double |
getPheromone(Sensor sensor)
Gets the pheromone trace with a given neighbor |
void |
removeService(Service service)
Removes a service from the set of offered services by this sensor |
void |
reset()
This method resets a Sensor to its initial state |
Service |
serve(Service service,
java.util.Vector<Sensor> path)
This method returns a requested service. |
void |
set_goodness(Service service,
double goodness)
Sets the goodness of a given service |
void |
set_requiredService(Service requiredService)
Updates the client required Service. |
void |
setHeuristic(Sensor sensor,
double value)
Sets the heuristic trace value of the link connecting to a certain neighbor |
static void |
setNumServers(int numServers)
Sets the number of servers |
void |
setPheromone(Sensor sensor,
double value)
Sets the pheromone trace value of the link connecting to a certain neighbor |
java.lang.String |
toString()
This method returns a String representation of this sensor |
| Methods inherited from class es.ants.felixgm.trmsim_wsn.network.Sensor |
|---|
addTransmittedDistance, cancelAllTimers, distance, distanceInHops, equals, findSensors, 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, resetId, run, set_TRModel_WSN, setActiveState, setCollusion, setDynamic, setMaxDistance, setRunningSimulation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static int _numServers
protected java.util.HashMap<LFTM_Service,Variable> _servicesGoodness
protected Variable clientConformity
protected Variable clientGoodness
protected double priceWeight
protected double costWeight
protected double deliveryWeight
protected double qualityWeight
| Constructor Detail |
|---|
public LFTM_Sensor()
public LFTM_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 Variable evaluateSatisfaction(Variable servicesComparison)
servicesComparison - Comparison between the expected and the actually received service
public Service serve(Service service,
java.util.Vector<Sensor> path)
serve in class Sensorservice - Requested servicepath - Path leading from the client requesting the service to the server providing it
public void addService(Service service,
double goodness)
Sensor
addService in class Sensorservice - The new service to be addedgoodness - The goodness when offering that new servicepublic void removeService(Service service)
Sensor
removeService in class Sensorservice - Service to be removed from the set of offered services by this sensor
public double get_goodness(Service service)
throws java.lang.Exception
Sensor
get_goodness in class Sensorservice - The service to get its goodness
java.lang.Exception - If this sensor does not offer the given service
public void set_goodness(Service service,
double goodness)
throws java.lang.Exception
Sensor
set_goodness in class Sensorservice - The service to set its goodnessgoodness - The goodness to be set
java.lang.Exception - If this sensor does not offer the given servicepublic void set_requiredService(Service requiredService)
Sensor
set_requiredService in class SensorrequiredService - New service.public void addLink(Sensor node)
Sensor
addLink in class Sensornode - Sensor to link topublic int get_numServers()
public static void setNumServers(int numServers)
numServers - Number of serverspublic double getPheromone(Sensor sensor)
sensor - One of this sensor's neighbors
public double getHeuristic(Sensor sensor)
sensor - One of this sensor's neighbors
public void setPheromone(Sensor sensor,
double value)
sensor - Neighbor whose pheromone trace is to be modifiedvalue - New pheromone value
public void setHeuristic(Sensor sensor,
double value)
sensor - Neighbor whose heuristic trace is to be modifiedvalue - New heuristic valuepublic Variable get_clientGoodness()
public double get_priceWeight()
public double get_costWeight()
public double get_deliveryWeight()
public double get_qualityWeight()
public void reset()
Sensor
reset in class Sensorpublic java.lang.String toString()
Sensor
toString in class Sensor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||