|
||||||||||
| 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.btrm_wsn.BTRM_Sensor
public class BTRM_Sensor
This class models a Sensor implementing BTRM-WSN
| Field Summary | |
|---|---|
protected static int |
_numServers
Number of servers composing the network this sensor belongs to |
| 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 | |
|---|---|
BTRM_Sensor()
This constructor creates a new Sensor implementing BTRM-WSN |
|
BTRM_Sensor(int id,
double x,
double y)
This constructor creates a new Sensor implementing BTRM-WSN |
|
| Method Summary | |
|---|---|
void |
addLink(Sensor node)
Adds a link to a given sensor |
int |
get_numServers()
Returns the number of servers of the network |
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 |
reset()
This method resets a Sensor to its initial state |
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 |
|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static int _numServers
| Constructor Detail |
|---|
public BTRM_Sensor()
public BTRM_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 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 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 | |||||||||