NPTLab
Class CompareTraces

java.lang.Object
  extended by NPTLab.CompareTraces

public class CompareTraces
extends java.lang.Object

Class that computes the similarty between two given traces of two different users.


Field Summary
static double similarity
          maps of wights and correspondign eigen vectors second node
 
Constructor Summary
CompareTraces()
           
 
Method Summary
static boolean compareTwoTracesMessage(Trace userTrace1, Trace userTrace2, int SimulationDays, double MessageOwnerSimilarity, core.Message m, DTNHost h)
          Computes the similarty between two given traces.
static void compareTwoTracesNodes(Trace userTrace1, Trace userTrace2, int SimulationDays, DTNHost h1, DTNHost h2)
           
static double getSimilarity(core.Message m, DTNHost h)
          Returns the last computed similarity
static java.util.Map<java.lang.String,java.lang.Double> getSimilarityMapNodes()
          Returns the map of all nodes similarities
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

similarity

public static double similarity
maps of wights and correspondign eigen vectors second node

Constructor Detail

CompareTraces

public CompareTraces()
Method Detail

compareTwoTracesMessage

public static boolean compareTwoTracesMessage(Trace userTrace1,
                                              Trace userTrace2,
                                              int SimulationDays,
                                              double MessageOwnerSimilarity,
                                              core.Message m,
                                              DTNHost h)
Computes the similarty between two given traces.

Parameters:
userTrace1 - Trace of Node1
userTrace2 - Trace of the Node2
SimulationDays - duration of the period in wich the Trace were populated
MessageOwnerSimilarity - similarity between the owner of the message trace and the trace of the target node
m - Message wich trace is compared.
Returns:
boolean true if similarity>MessageOwnerSimilarity, so the message must be passed

compareTwoTracesNodes

public static void compareTwoTracesNodes(Trace userTrace1,
                                         Trace userTrace2,
                                         int SimulationDays,
                                         DTNHost h1,
                                         DTNHost h2)

getSimilarity

public static double getSimilarity(core.Message m,
                                   DTNHost h)
Returns the last computed similarity

Parameters:
m - Message which similarity is to be returned
h - the DTN wich the similarty is refferring to
Returns:
double Similarity

getSimilarityMapNodes

public static java.util.Map<java.lang.String,java.lang.Double> getSimilarityMapNodes()
Returns the map of all nodes similarities

Returns:
Map