机会路由源代码+仿真工具(SCORP)


机会路由源代码+仿真工具: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_ScorpHISTORY.txt
     文件       32783  2009-01-27 22:10  one_1.4.1_ScorpLICENSE.txt
     文件       33303  2011-02-01 05:29  one_1.4.1_ScorpREADME.txt
     文件        1475  2009-01-27 22:10  one_1.4.1_ScorpWDM_conf_help.txt
     目录           0  2018-07-26 16:38  one_1.4.1_Scorpapplications
     文件        5578  2018-07-26 16:38  one_1.4.1_ScorpapplicationsPingApplication.class
     文件        7107  2010-03-16 06:00  one_1.4.1_ScorpapplicationsPingApplication.java
     文件        3254  2009-04-29 19:38  one_1.4.1_Scorpcluster_settings.txt
     文件         278  2009-01-27 22:10  one_1.4.1_Scorpcompile.bat
     目录           0  2018-07-26 18:50  one_1.4.1_Scorpcore
     文件        2035  2018-07-26 16:38  one_1.4.1_ScorpcoreApplication.class
     文件        3497  2010-03-10 08:05  one_1.4.1_ScorpcoreApplication.java
     文件         217  2018-07-26 16:38  one_1.4.1_ScorpcoreApplicationListener.class
     文件         931  2010-03-10 08:05  one_1.4.1_ScorpcoreApplicationListener.java
     文件        3251  2018-07-26 16:38  one_1.4.1_ScorpcoreCBRConnection.class
     文件        3813  2010-03-19 06:37  one_1.4.1_ScorpcoreCBRConnection.java
     文件        3734  2018-07-26 16:38  one_1.4.1_ScorpcoreConnection.class
     文件        6111  2010-03-10 08:05  one_1.4.1_ScorpcoreConnection.java
     文件         209  2018-07-26 16:38  one_1.4.1_ScorpcoreConnectionListener.class
     文件         751  2010-03-10 08:05  one_1.4.1_ScorpcoreConnectionListener.java
     文件        2884  2018-07-26 16:38  one_1.4.1_ScorpcoreCoord.class
     文件        3338  2010-03-10 08:05  one_1.4.1_ScorpcoreCoord.java
     文件         572  2018-07-26 16:38  one_1.4.1_ScorpcoreDTN2Manager$EIDHost.class
     文件        5752  2018-07-26 16:38  one_1.4.1_ScorpcoreDTN2Manager.class
     文件        5958  2010-03-10 08:05  one_1.4.1_ScorpcoreDTN2Manager.java
     文件       12046  2018-07-26 18:51  one_1.4.1_ScorpcoreDTNHost.class
     文件       15644  2018-07-26 18:51  one_1.4.1_ScorpcoreDTNHost.java
     文件        5878  2018-07-26 16:38  one_1.4.1_ScorpcoreDTNSim.class
............此处省略558个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)