public class FloatingContentRouter extends ActiveRouter
| Modifier and Type | Field and Description |
|---|---|
static int |
DEL_ALG_COSINE |
static int |
DEL_ALG_EXP |
static int |
DEL_ALG_FIXED |
static int |
DEL_ALG_LINEAR |
static int |
DEL_ALG_NONE |
static int |
DEL_ENCOUNTER |
static int |
DEL_IMMEDIATE |
protected java.util.Random |
delRng |
static java.lang.String |
FC_A |
static java.lang.String |
FC_ANCHOR |
static java.lang.String |
FC_DEL_ALG |
static java.lang.String |
FC_DELETION |
static java.lang.String |
FC_LOCATION_ERROR_RANGE |
static java.lang.String |
FC_LOCATION_RATIO |
static java.lang.String |
FC_LOCATION_SOURCE |
static java.lang.String |
FC_LOCATION_UPDATE_INTERVAL |
static java.lang.String |
FC_NS |
static java.lang.String |
FC_R |
static java.lang.String |
FC_REPL_ALG |
static java.lang.String |
FC_REPLICATION |
static java.lang.String |
FC_SEED |
static java.lang.String |
FC_SRCLOC
Message property keys
|
static java.lang.String |
FC_TTL |
static java.lang.String |
FC_TTL_VAL |
static java.lang.String |
FC_TYPE |
static int |
LOC_SRC_GPS |
static int |
LOC_SRC_HOTSPOT |
static int |
LOC_SRC_NONE |
protected java.util.Random |
rdAngle |
protected java.util.Random |
rdDistance |
static int |
REPL_ALG_COSINE |
static int |
REPL_ALG_EXP |
static int |
REPL_ALG_FIXED |
static int |
REPL_ALG_LINEAR |
static int |
REPL_ALG_NONE |
static int |
REPL_FIFO |
static int |
REPL_RND |
static int |
REPL_SAF |
static int |
REPL_STF |
static int |
REPL_STF2 |
static int |
REPL_SVF |
static int |
REPL_SVF2 |
protected java.util.Random |
replRng |
protected java.util.Random |
rng |
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 |
FloatingContentRouter(FloatingContentRouter r)
Copyconstructor.
|
|
FloatingContentRouter(Settings s)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changedConnection(Connection conn)
Called when a connection's state changes.
|
boolean |
createNewMessage(Message msg)
Creates a new message to the router.
|
protected int |
deletion_check(double h,
double r,
double a) |
Coord |
getLastKnownLocation() |
Coord |
getLocation() |
int |
getLocationSource() |
Coord |
getLocationWithError(double min,
double max,
double interval,
int seed) |
Message |
messageTransferred(java.lang.String id,
DTNHost from)
This method should be called (on the receiving host) after a message
was successfully transferred.
|
FloatingContentRouter |
replicate()
Creates a replicate of this router.
|
protected void |
transferDone(Connection conn)
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, dropExpiredMessages, exchangeDeliverableMessages, getConnections, getMessagesForConnected, getNextMessageToRemove, getRoutingInfo, 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 int REPL_FIFO
public static final int REPL_RND
public static final int REPL_SAF
public static final int REPL_SVF
public static final int REPL_STF
public static final int REPL_SVF2
public static final int REPL_STF2
public static final int REPL_ALG_NONE
public static final int REPL_ALG_LINEAR
public static final int REPL_ALG_EXP
public static final int REPL_ALG_COSINE
public static final int REPL_ALG_FIXED
public static final int DEL_ALG_NONE
public static final int DEL_ALG_LINEAR
public static final int DEL_ALG_EXP
public static final int DEL_ALG_COSINE
public static final int DEL_ALG_FIXED
public static final int LOC_SRC_NONE
public static final int LOC_SRC_GPS
public static final int LOC_SRC_HOTSPOT
public static final int DEL_ENCOUNTER
public static final int DEL_IMMEDIATE
public static final java.lang.String FC_SEED
public static final java.lang.String FC_NS
public static final java.lang.String FC_DELETION
public static final java.lang.String FC_REPLICATION
public static final java.lang.String FC_REPL_ALG
public static final java.lang.String FC_DEL_ALG
public static final java.lang.String FC_LOCATION_ERROR_RANGE
public static final java.lang.String FC_LOCATION_UPDATE_INTERVAL
public static final java.lang.String FC_LOCATION_SOURCE
public static final java.lang.String FC_LOCATION_RATIO
public static final java.lang.String FC_SRCLOC
public static final java.lang.String FC_ANCHOR
public static final java.lang.String FC_A
public static final java.lang.String FC_R
public static final java.lang.String FC_TYPE
public static final java.lang.String FC_TTL
public static final java.lang.String FC_TTL_VAL
protected java.util.Random rng
protected java.util.Random replRng
protected java.util.Random delRng
protected java.util.Random rdAngle
protected java.util.Random rdDistance
public FloatingContentRouter(Settings s)
s - The settings objectprotected FloatingContentRouter(FloatingContentRouter r)
r - The router prototype where setting values are copied frompublic boolean createNewMessage(Message msg)
MessageRoutercreateNewMessage in class ActiveRoutermsg - The message to createpublic void changedConnection(Connection conn)
ActiveRouterchangedConnection in class ActiveRouterconn - The connection that changedpublic void update()
ActiveRouterupdate in class ActiveRouterActiveRouter.addToSendingConnections(Connection)protected int deletion_check(double h,
double r,
double a)
protected void transferDone(Connection conn)
ActiveRouterActiveRouter.update().
Subclasses that are interested of the event may want to override this.transferDone in class ActiveRouterconn - The connection whose transfer was finalizedpublic FloatingContentRouter replicate()
MessageRouterreplicate in class MessageRouterpublic Message messageTransferred(java.lang.String id, DTNHost from)
MessageRoutermessageTransferred in class ActiveRouterid - Id of the transferred messagefrom - Host the message was from (previous hop)public int getLocationSource()
public Coord getLastKnownLocation()
public Coord getLocation()
public Coord getLocationWithError(double min, double max, double interval, int seed)