es.ants.felixgm.trmsim_wsn
Class Simulation

java.lang.Object
  extended by java.util.Observable
      extended by es.ants.felixgm.trmsim_wsn.Simulation
All Implemented Interfaces:
java.lang.Runnable

public class Simulation
extends java.util.Observable
implements java.lang.Runnable

This class is used to run simulations of a trust and reputation model

Since:
0.1
Version:
0.5
Author:
Félix Gómez Mármol, Gregorio Martínez Pérez

Constructor Summary
Simulation(java.util.Collection<java.util.Observer> observers, Service requiredService, boolean dynamic, boolean oscillating, boolean collusion, int numExecutions, Network network)
          Creates a new Simulation
Simulation(java.util.Collection<java.util.Observer> observers, Service requiredService, int minNumSensors, int maxNumSensors, double probClients, double probRelay, double probMalicious, double radioRange, boolean dynamic, boolean oscillating, boolean collusion, int numNetworks, int numExecutions)
          Creates a new Simulation
 
Method Summary
 java.util.Collection<Outcome> get_globalOutcomes()
          This method returns the global outcomes achieved by this simulations
 void run()
          Starts the simulations
 void stop()
          Stops the simulations
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Simulation

public Simulation(java.util.Collection<java.util.Observer> observers,
                  Service requiredService,
                  int minNumSensors,
                  int maxNumSensors,
                  double probClients,
                  double probRelay,
                  double probMalicious,
                  double radioRange,
                  boolean dynamic,
                  boolean oscillating,
                  boolean collusion,
                  int numNetworks,
                  int numExecutions)
Creates a new Simulation

Parameters:
observers - Used to communicate changes to the GUI
requiredService - Service requested by every client of each WSN
minNumSensors - Minimum number of sensors composing every WSN
maxNumSensors - Maximum number of sensors composing every WSN
probClients - The probability of a node to act as a client
probRelay - The probability of a server to act just as a relay node (not offering the required service)
probMalicious - The probability of a server offering the required service to act as a malicious server (not providing the offered service, or providing a worse or different one)
radioRange - Maximum wireless range of every sensor. It determines the neighborhood of every sensor
dynamic - It determines if the WSN will be dynamic (nodes sometimes switch off in order to save battery, breaking all their links)
oscillating - It determines if the goodness of the servers belonging to the created WSN will change along the time
collusion - It determines if the malicious servers belonging to the created WSN will form a collusion among them
numNetworks - Number of wireless sensor networks to test
numExecutions - Number of service requests of every client composing each WSN

Simulation

public Simulation(java.util.Collection<java.util.Observer> observers,
                  Service requiredService,
                  boolean dynamic,
                  boolean oscillating,
                  boolean collusion,
                  int numExecutions,
                  Network network)
Creates a new Simulation

Parameters:
observers - Used to communicate changes to the GUI
requiredService - Service requested by every client of the specified WSN
dynamic - It determines if the WSN will be dynamic (nodes sometimes switch off in order to save battery, breaking all their links)
oscillating - It determines if the goodness of the servers belonging to the created WSN will change along the time
collusion - It determines if the malicious servers belonging to the created WSN will form a collusion among them
numExecutions - Number of service requests of every client composing the specified WSN
network - Wireless sensor network to test
Method Detail

stop

public void stop()
Stops the simulations


run

public void run()
Starts the simulations

Specified by:
run in interface java.lang.Runnable

get_globalOutcomes

public java.util.Collection<Outcome> get_globalOutcomes()
This method returns the global outcomes achieved by this simulations

Returns:
The global outcomes achieved by this simulations