NPTLab
Class DTNHostWrapper

java.lang.Object
  extended by NPTLab.DTNHostWrapper

public class DTNHostWrapper
extends java.lang.Object

Class that Wraps DTNHost and add the method and the objects needed by the ProfileCast routing algorithm.

Author:
Andrea Campanella, NPTLab, Public university of Milan, 2014

Field Summary
 java.util.Map<core.Message,java.lang.Double> similarityMap
           
 
Constructor Summary
DTNHostWrapper(DTNHost h)
          map containing all the similarities beetween this node and the messages he encountered
 
Method Summary
 void add(core.Coord c, int day, double time)
          Method that adds to the set of coordinates for the host, the new coord element, the day and the time spent at the given location
 void add(core.Message m, double similarity)
          Adds to the message with its similarity to this DTNHostWrapper to its map of similarities.
 void createTrace(int simulationDays)
          Creates the Trace for a specific host and adds the host and its new trace to the GLobal Map of Traces
 double getSimilarity(core.Message m)
          Returns the similarity for the passed Message
 java.util.Map<core.Message,java.lang.Double> returnSimilarityMap()
          Returns the similarity map of this DTNHostWrapper
 Trace returnTrace()
          Returns the trace for the specific DTNHostWrapper
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

similarityMap

public java.util.Map<core.Message,java.lang.Double> similarityMap
Constructor Detail

DTNHostWrapper

public DTNHostWrapper(DTNHost h)
map containing all the similarities beetween this node and the messages he encountered

Method Detail

add

public void add(core.Coord c,
                int day,
                double time)
Method that adds to the set of coordinates for the host, the new coord element, the day and the time spent at the given location

Parameters:
c - Coord the location
day - Int, the day in wich the location was visited
time - Double the time spent at the given location

createTrace

public void createTrace(int simulationDays)
Creates the Trace for a specific host and adds the host and its new trace to the GLobal Map of Traces

Parameters:
simulationDays - int the number of days in which were saved location and time spent

returnTrace

public Trace returnTrace()
Returns the trace for the specific DTNHostWrapper


add

public void add(core.Message m,
                double similarity)
Adds to the message with its similarity to this DTNHostWrapper to its map of similarities.

Parameters:
m - Message the message to be addes
similarity - double the computed similarity with the trace of the message.

getSimilarity

public double getSimilarity(core.Message m)
Returns the similarity for the passed Message

Parameters:
m - the message in which similarity we are interested
Returns:
double Similarity

returnSimilarityMap

public java.util.Map<core.Message,java.lang.Double> returnSimilarityMap()
Returns the similarity map of this DTNHostWrapper

Returns:
Map