资源简介
机会路由源代码+仿真工具:The Social-aware Content-based Opportunistic Routing Protocol (SCORP)
代码片段和文件信息
/*
* Copyright 2010 Aalto University ComNet
* Released under GPLv3. See LICENSE.txt for details.
*/
package applications;
import java.util.Random;
import report.PingAppReporter;
import core.Application;
import core.DTNHost;
import core.Message;
import core.Settings;
import core.SimClock;
import core.SimScenario;
import core.World;
/**
* Simple ping application to demonstrate the application support. The
* application can be configured to send pings with a fixed interval or to only
* answer to pings it receives. When the application receives a ping it sends
* a pong message in response.
*
* The corresponding PingAppReporter
class can be used to record
* information about the application behavior.
*
* @see PingAppReporter
* @author teemuk
*/
public class PingApplication extends Application {
/** Run in passive mode - don‘t generate pings but respond */
public static final String PING_PASSIVE = “passive“;
/** Ping generation interval */
public static final String PING_INTERVAL = “interval“;
/** Ping interval offset - avoids synchronization of ping sending */
public static final String PING_OFFSET = “offset“;
/** Destination address range - inclusive lower exclusive upper */
public static final String PING_DEST_RANGE = “destinationRange“;
/** Seed for the app‘s random number generator */
public static final String PING_SEED = “seed“;
/** Size of the ping message */
public static final String PING_PING_SIZE = “pingSize“;
/** Size of the pong message */
public static final String PING_PONG_SIZE = “pongSize“;
/** Application ID */
public static final String APP_ID = “fi.tkk.netlab.PingApplication“;
// Private vars
private double lastPing = 0;
private double interval = 500;
private boolean passive = false;
private int seed = 0;
private int destMin=0;
private int destMax=1;
private int pingSize=1;
private int pongSize=1;
private Random rng;
/**
* Creates a new ping application with the given settings.
*
* @param s Settings to use for initializing the application.
*/
public PingApplication(Settings s) {
if (s.contains(PING_PASSIVE)){
this.passive = s.getBoolean(PING_PASSIVE);
}
if (s.contains(PING_INTERVAL)){
this.interval = s.getDouble(PING_INTERVAL);
}
if (s.contains(PING_OFFSET)){
this.lastPing = s.getDouble(PING_OFFSET);
}
if (s.contains(PING_SEED)){
this.seed = s.getInt(PING_SEED);
}
if (s.contains(PING_PING_SIZE)) {
this.pingSize = s.getInt(PING_PING_SIZE);
}
if (s.contains(PING_PONG_SIZE)) {
this.pongSize = s.getInt(PING_PONG_SIZE);
}
if (s.contains(PING_DEST_RANGE)){
int[] destination = s.getCsvInts(PING_DEST_RANGE2);
this.destMin = destination[0];
this.destMax = destination[1];
}
rng = new Random(this.seed);
super.setAppID(APP_ID);
}
/**
* Copy-constructor
*
* @param a
*/
public PingApplication(PingApplication a) {
super(a);
this.lastPing = a.getLastPing();
this.interval = a.getI
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-26 18:58 one_1.4.1_Scorp\
文件 422 2018-07-26 16:38 one_1.4.1_Scorp\.classpath
文件 391 2018-07-26 16:37 one_1.4.1_Scorp\.project
文件 6940 2011-02-01 06:10 one_1.4.1_Scorp\HISTORY.txt
文件 32783 2009-01-27 22:10 one_1.4.1_Scorp\LICENSE.txt
文件 33303 2011-02-01 05:29 one_1.4.1_Scorp\README.txt
文件 1475 2009-01-27 22:10 one_1.4.1_Scorp\WDM_conf_help.txt
目录 0 2018-07-26 16:38 one_1.4.1_Scorp\applications\
文件 5578 2018-07-26 16:38 one_1.4.1_Scorp\applications\PingApplication.class
文件 7107 2010-03-16 06:00 one_1.4.1_Scorp\applications\PingApplication.java
文件 3254 2009-04-29 19:38 one_1.4.1_Scorp\cluster_settings.txt
文件 278 2009-01-27 22:10 one_1.4.1_Scorp\compile.bat
目录 0 2018-07-26 18:50 one_1.4.1_Scorp\core\
文件 2035 2018-07-26 16:38 one_1.4.1_Scorp\core\Application.class
文件 3497 2010-03-10 08:05 one_1.4.1_Scorp\core\Application.java
文件 217 2018-07-26 16:38 one_1.4.1_Scorp\core\ApplicationListener.class
文件 931 2010-03-10 08:05 one_1.4.1_Scorp\core\ApplicationListener.java
文件 3251 2018-07-26 16:38 one_1.4.1_Scorp\core\CBRConnection.class
文件 3813 2010-03-19 06:37 one_1.4.1_Scorp\core\CBRConnection.java
文件 3734 2018-07-26 16:38 one_1.4.1_Scorp\core\Connection.class
文件 6111 2010-03-10 08:05 one_1.4.1_Scorp\core\Connection.java
文件 209 2018-07-26 16:38 one_1.4.1_Scorp\core\ConnectionListener.class
文件 751 2010-03-10 08:05 one_1.4.1_Scorp\core\ConnectionListener.java
文件 2884 2018-07-26 16:38 one_1.4.1_Scorp\core\Coord.class
文件 3338 2010-03-10 08:05 one_1.4.1_Scorp\core\Coord.java
文件 572 2018-07-26 16:38 one_1.4.1_Scorp\core\DTN2Manager$EIDHost.class
文件 5752 2018-07-26 16:38 one_1.4.1_Scorp\core\DTN2Manager.class
文件 5958 2010-03-10 08:05 one_1.4.1_Scorp\core\DTN2Manager.java
文件 12046 2018-07-26 18:51 one_1.4.1_Scorp\core\DTNHost.class
文件 15644 2018-07-26 18:51 one_1.4.1_Scorp\core\DTNHost.java
文件 5878 2018-07-26 16:38 one_1.4.1_Scorp\core\DTNSim.class
............此处省略558个文件信息
- 上一篇:redis安装包
- 下一篇:eclipse安卓工程相册、相机选择图片功能
相关资源
- springboot+rabbitmq项目demo(亲测可正常运
- jxbrowser 所有版本通用的破解包
- 2017年-传智播客-张志君老师-SpringBoo
- Blob.js+Export2Excel.js
- POI中文帮助文档附带api手册.zip
- 2018双十一阿里供应链服务平台讲座
- 原银在线信贷平台概要设计说明书v
- office_word_api 开发文档
- sun.misc.Unsafe源码
- netty的视频90集
- Drool最新 中文文档
- mybatis3-api.chm
- 蚂蚁课堂每特学院第二期,高清不加
- poi 动态修改docx窗体域内容,并存为
- reportdesign基于lodop的vue简单打印设计工
- SpringBoot +vue 框架项目.zip
- 基于Servlet下的验证码功能的实现
- jdk-11中文api修订版.CHM
- 招商银行信用卡中心2018春招IT笔试数
- 2019年独家Kubernetes K8S与Jenkins的CI CD高
- 新闻管理系统前台和后台
- SWT帮助文档
- 手机银行后台管理系统
- js特效40套
- 差旅管理系统
- 支付宝电脑网站支付
- 基于Eclipse编写的在线支付软件
- mavenRepository 仓库 依赖
- 旅游订单系统
- 健身房管理系统161202
评论
共有 条评论