routing
Class EpidemicRouter

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

public class EpidemicRouter
extends ActiveRouter

Epidemic message router with drop-oldest buffer and only single transferring connections at a time.


Field Summary
 
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 EpidemicRouter(EpidemicRouter r)
          Copy constructor.
  EpidemicRouter(Settings s)
          Constructor.
 
Method Summary
 EpidemicRouter 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, changedConnection, 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, getRoutingInfo, 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
 

Constructor Detail

EpidemicRouter

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

Parameters:
s - The settings object

EpidemicRouter

protected EpidemicRouter(EpidemicRouter r)
Copy constructor.

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

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)

replicate

public EpidemicRouter 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