routing
Class ProphetRouter

java.lang.Object
  extended by routing.MessageRouter
      extended by routing.ActiveRouter
          extended by routing.ProphetRouter

public class ProphetRouter
extends ActiveRouter

Implementation of PRoPHET router as described in Probabilistic routing in intermittently connected networks by Anders Lindgren et al.


Field Summary
static java.lang.String BETA_S
          Transitivity scaling constant (beta) -setting id ("beta").
static double DEFAULT_BETA
          delivery predictability transitivity scaling constant default value
static double GAMMA
          delivery predictability aging constant
static double P_INIT
          delivery predictability initialization constant
static java.lang.String PROPHET_NS
          Prophet router's setting namespace ("ProphetRouter")
static java.lang.String SECONDS_IN_UNIT_S
          Number of seconds in time unit -setting id ("secondsInTimeUnit").
 
Fields inherited from class routing.ActiveRouter
DELETE_DELIVERED_S, deleteDelivered, RESPONSE_PREFIX, sendingConnections, TTL_CHECK_INTERVAL
 
Fields inherited from class routing.MessageRouter
B_SIZE_S, DENIED_NO_SPACE, DENIED_OLD, DENIED_TTL, DENIED_UNSPECIFIED, MSG_TTL_S, msgTtl, Q_MODE_FIFO, Q_MODE_RANDOM, RCV_OK, SEND_QUEUE_MODE_S, TRY_LATER_BUSY
 
Constructor Summary
protected ProphetRouter(ProphetRouter r)
          Copyconstructor.
  ProphetRouter(Settings s)
          Constructor.
 
Method Summary
 void changedConnection(Connection con)
          Called when a connection's state changes.
 double getPredFor(DTNHost host)
          Returns the current prediction (P) value for a host or 0 if entry for the host doesn't exist.
 RoutingInfo getRoutingInfo()
          Returns routing information about this router.
 MessageRouter replicate()
          Creates a replicate of this router.
 void update()
          Checks out all sending connections to finalize the ready ones and abort those whose connection went down.
 
Methods inherited from class routing.ActiveRouter
addToSendingConnections, canStartTransfer, checkReceiving, createNewMessage, dropExpiredMessages, exchangeDeliverableMessages, getConnections, getMessagesForConnected, getOldestMessage, init, isSending, isTransferring, makeRoomForMessage, makeRoomForNewMessage, messageTransferred, receiveMessage, requestDeliverableMessages, shuffleMessages, startTransfer, transferAborted, transferDone, tryAllMessages, tryAllMessagesToAllConnections, tryMessagesForConnected, tryMessagesToConnections
 
Methods inherited from class routing.MessageRouter
addApplication, addToMessages, compareByQueueMode, deleteMessage, getApplications, getBufferSize, getFreeBufferSize, getHost, getMessage, getMessageCollection, getNrofMessages, hasMessage, isDeliveredMessage, isIncomingMessage, messageAborted, putToIncomingBuffer, removeFromIncomingBuffer, removeFromMessages, sendMessage, sortByQueueMode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

P_INIT

public static final double P_INIT
delivery predictability initialization constant

See Also:
Constant Field Values

DEFAULT_BETA

public static final double DEFAULT_BETA
delivery predictability transitivity scaling constant default value

See Also:
Constant Field Values

GAMMA

public static final double GAMMA
delivery predictability aging constant

See Also:
Constant Field Values

PROPHET_NS

public static final java.lang.String PROPHET_NS
Prophet router's setting namespace ("ProphetRouter")

See Also:
Constant Field Values

SECONDS_IN_UNIT_S

public static final java.lang.String SECONDS_IN_UNIT_S
Number of seconds in time unit -setting id ("secondsInTimeUnit"). How many seconds one time unit is when calculating aging of delivery predictions. Should be tweaked for the scenario.

See Also:
Constant Field Values

BETA_S

public static final java.lang.String BETA_S
Transitivity scaling constant (beta) -setting id ("beta"). Default value for setting is DEFAULT_BETA.

See Also:
Constant Field Values
Constructor Detail

ProphetRouter

public ProphetRouter(Settings s)
Constructor. Creates a new message router based on the settings in the given Settings object.

Parameters:
s - The settings object

ProphetRouter

protected ProphetRouter(ProphetRouter r)
Copyconstructor.

Parameters:
r - The router prototype where setting values are copied from
Method Detail

changedConnection

public void changedConnection(Connection con)
Description copied from class: ActiveRouter
Called when a connection's state changes. This version doesn't do anything but subclasses may want to override this.

Overrides:
changedConnection in class ActiveRouter
Parameters:
con - The connection that changed

getPredFor

public double getPredFor(DTNHost host)
Returns the current prediction (P) value for a host or 0 if entry for the host doesn't exist.

Parameters:
host - The host to look the P for
Returns:
the current P value

update

public void update()
Description copied from class: ActiveRouter
Checks out all sending connections to finalize the ready ones and abort those whose connection went down. Also drops messages whose TTL <= 0 (checking every one simulated minute).

Overrides:
update in class ActiveRouter
See Also:
ActiveRouter.addToSendingConnections(Connection)

getRoutingInfo

public RoutingInfo getRoutingInfo()
Description copied from class: MessageRouter
Returns routing information about this router.

Overrides:
getRoutingInfo in class MessageRouter
Returns:
The routing information.

replicate

public MessageRouter replicate()
Description copied from class: MessageRouter
Creates a replicate of this router. The replicate has the same settings as this router but empty buffers and routing tables.

Specified by:
replicate in class MessageRouter
Returns:
The replicate