public class MaxPropRouter extends ActiveRouter
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALPHA_S
The alpha parameter string
|
static int |
BYTES_TRANSFERRED_AVG_SAMPLES
Over how many samples the "average number of bytes transferred per
transfer opportunity" is taken
|
static double |
DEFAULT_ALPHA
The default value for alpha
|
static int |
DEFAULT_PROB_SET_MAX_SIZE
Default value for the meeting probability set maximum size (50).
|
static java.lang.String |
MAXPROP_NS
Router's setting namespace ("MaxPropRouter")
|
static java.lang.String |
PROB_SET_MAX_SIZE_S
Meeting probability set maximum size -setting id ("probSetMaxSize").
|
DELETE_DELIVERED_S, deleteDelivered, RESPONSE_PREFIX, sendingConnectionsB_SIZE_S, DENIED_LOW_RESOURCES, DENIED_NO_SPACE, DENIED_OLD, DENIED_POLICY, DENIED_TTL, DENIED_UNSPECIFIED, MSG_TTL_S, msgTtl, Q_MODE_FIFO, Q_MODE_RANDOM, RCV_OK, SEND_QUEUE_MODE_S, TRY_LATER_BUSY| Modifier | Constructor and Description |
|---|---|
protected |
MaxPropRouter(MaxPropRouter r)
Copy constructor.
|
|
MaxPropRouter(Settings settings)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
calcThreshold()
Calculates and returns the current threshold value for the buffer's split
based on the average number of bytes transferred per transfer opportunity
and the hop counts of the messages in the buffer.
|
void |
changedConnection(Connection con)
Called when a connection's state changes.
|
double |
getCost(DTNHost from,
DTNHost to)
Returns the message delivery cost between two hosts from this host's
point of view.
|
protected Message |
getNextMessageToRemove(boolean excludeMsgBeingSent)
Returns the next message that should be dropped, according to MaxProp's
message ordering scheme (see
MaxPropTupleComparator). |
RoutingInfo |
getRoutingInfo()
Returns routing information about this router.
|
Message |
messageTransferred(java.lang.String id,
DTNHost from)
This method should be called (on the receiving host) after a message
was successfully transferred.
|
MessageRouter |
replicate()
Creates a replicate of this router.
|
protected void |
transferDone(Connection con)
Method is called just before a transfer is finalized
at
ActiveRouter.update(). |
void |
update()
Checks out all sending connections to finalize the ready ones
and abort those whose connection went down.
|
addToSendingConnections, canStartTransfer, checkReceiving, createNewMessage, dropExpiredMessages, exchangeDeliverableMessages, getConnections, getMessagesForConnected, hasEnergy, init, isSending, isTransferring, makeRoomForMessage, makeRoomForNewMessage, receiveMessage, requestDeliverableMessages, shuffleMessages, startTransfer, transferAborted, tryAllMessages, tryAllMessagesToAllConnections, tryMessagesForConnected, tryMessagesToConnectionsaddApplication, addToMessages, compareByQueueMode, deleteMessage, getApplications, getBufferSize, getFreeBufferSize, getHost, getMessage, getMessageCollection, getNrofMessages, hasMessage, isBlacklistedMessage, isDeliveredMessage, isIncomingMessage, messageAborted, putToIncomingBuffer, removeFromIncomingBuffer, removeFromMessages, sendMessage, sortByQueueMode, toStringpublic static final java.lang.String MAXPROP_NS
public static final java.lang.String PROB_SET_MAX_SIZE_S
public static final int DEFAULT_PROB_SET_MAX_SIZE
public static int BYTES_TRANSFERRED_AVG_SAMPLES
public static final java.lang.String ALPHA_S
public static final double DEFAULT_ALPHA
public MaxPropRouter(Settings settings)
settings - The settings objectprotected MaxPropRouter(MaxPropRouter r)
r - The router prototype where setting values are copied frompublic void changedConnection(Connection con)
ActiveRouterchangedConnection in class ActiveRoutercon - The connection that changedpublic Message messageTransferred(java.lang.String id, DTNHost from)
MessageRoutermessageTransferred in class ActiveRouterid - Id of the transferred messagefrom - Host the message was from (previous hop)protected void transferDone(Connection con)
ActiveRouter.update(). MaxProp makes book keeping of the
delivered messages so their IDs are stored.transferDone in class ActiveRoutercon - The connection whose transfer was finalizedprotected Message getNextMessageToRemove(boolean excludeMsgBeingSent)
MaxPropTupleComparator).getNextMessageToRemove in class ActiveRouterexcludeMsgBeingSent - If true, excludes message(s) that are
being sent from the next-to-be-dropped check (i.e., if next message to
drop is being sent, the following message is returned)public void update()
ActiveRouterupdate in class ActiveRouterActiveRouter.addToSendingConnections(Connection)public double getCost(DTNHost from, DTNHost to)
from - The host where a message is coming fromto - The host where a message would be destined topublic int calcThreshold()
public RoutingInfo getRoutingInfo()
MessageRoutergetRoutingInfo in class ActiveRouterpublic MessageRouter replicate()
MessageRouterreplicate in class MessageRouter