资源简介
DTN网络仿真工具ONE1.4.1版本。欢迎大家下载
代码片段和文件信息
/*
* 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3254 2009-04-29 14:38 one_1.4.1\one_1.4.1\cluster_settings.txt
文件 5731 2010-03-19 00:06 one_1.4.1\one_1.4.1\default_settings.txt
文件 1475 2009-01-27 16:10 one_1.4.1\one_1.4.1\WDM_conf_help.txt
文件 76 2011-01-31 23:41 one_1.4.1\one_1.4.1\one.bat
文件 278 2009-01-27 16:10 one_1.4.1\one_1.4.1\compile.bat
文件 356 2009-01-27 16:10 one_1.4.1\one_1.4.1\snw_comparison_settings.txt
文件 139 2009-01-27 16:10 one_1.4.1\one_1.4.1\snw_settings.txt
文件 646 2010-03-19 00:06 one_1.4.1\one_1.4.1\prophet_settings.txt
文件 6940 2011-02-01 00:10 one_1.4.1\one_1.4.1\HISTORY.txt
文件 88 2011-01-31 23:41 one_1.4.1\one_1.4.1\one.sh
文件 513 2010-03-18 13:30 one_1.4.1\one_1.4.1\ping_app_settings.txt
文件 32783 2009-01-27 16:10 one_1.4.1\one_1.4.1\LICENSE.txt
文件 33303 2011-01-31 23:29 one_1.4.1\one_1.4.1\README.txt
文件 55 2009-01-27 16:10 one_1.4.1\one_1.4.1\epidemic_settings.txt
文件 1998 2010-03-10 02:05 one_1.4.1\one_1.4.1\ui\DTNSimTextUI.java
文件 4136 2010-03-16 00:00 one_1.4.1\one_1.4.1\ui\DTNSimUI.java
文件 186 2009-01-27 16:10 one_1.4.1\one_1.4.1\ui\package.html
文件 4166 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\DistrictsOff.txt
文件 9169 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\OfficeWaitCoeff1.txt
文件 4154 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\Density500.txt
文件 4240 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\ManhattanSpecialOfficeSize200.txt
文件 9149 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\TimeDiffEven.txt
文件 3581 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\RWPSetting.txt
文件 4240 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\ManhattanSpecialOfficeSize300.txt
文件 9119 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\BusVsCar0.txt
文件 4207 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\Density2000InfBuffer.txt
文件 9161 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\ShoppingWait4h.txt
文件 9155 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\OfficeSize500.txt
文件 9180 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\WorkDayLength43200.txt
文件 4159 2009-01-27 16:10 one_1.4.1\one_1.4.1\wdm_settings\NrOffices50.txt
............此处省略330个文件信息
- 上一篇:交通灯数字电路课程设计报告
- 下一篇:RTP打包与解析,荷载PS和H264
相关资源
- PCL-1.8.1-AllInOne-msvc2015-win64
- PCL-1.8.1-AllInOne-msvc2017-win64
- xlwt-1.0.0-py2.py3-none-any.whl
- urllib3-1.21.1-py2.py3-none-any.whl
- 论文研究 - 功能磁共振成像fMRI展示了
- Regioselective glucuronidation of tanshinone I
- PCL-1.7.2-AllInOne-msvc2013-win32.exe
- PyInstaller-3.5-py2.py3-none-any.whl
- spyder-4.1.3-py3-none-any.whl
- arm-none-eabi-gcc工具集合 for MinGW
- pygraphviz-1.3.1-cp27-none-win_amd64.whl
- pip-9.0.1-py2.py3-none-any.whl
评论
共有 条评论