资源简介
芬兰人开发的一个专门用于DTN网络仿真的软件,用Java语言写的,该模拟器本身能支持First Contact, Epidemic, Spray and Wait,
Direct delivery, PRoPHET and MaxProp这几种路由。
具体的安装方法里面有一个README.txt,很有用,不仅介绍了the ONE的一些性能,还有具体的安装以及示例。由于本身只是一些源代码,所以需要用户重新编译。具体的方法是:
1、安装Java5,配置好路径等;
2、点击文件夹下的compile.bat进行编译;
3、运行one.bat,就可以看见GUI了,此时模拟的是default。txt配置的DTN网络,如果要自己配置的DTN网络,则输入one My*.txt即可。
希望能对大家有用,另外还有一个用于DTN网络模拟的软件叫DTNsim2,是加拿大的waterloo 大学开发的
代码片段和文件信息
/*
* Copyright 2008 TKK/ComNet
* Released under GPLv3. See LICENSE.txt for details.
*/
package core;
import routing.MessageRouter;
/**
* A connection between two DTN nodes.
*/
public class Connection {
private DTNHost toNode;
private DTNHost fromNode;
private DTNHost msgFromNode;
private boolean isUp;
private int speed;
private Message msgOnFly;
private double transferDoneTime;
/** how many bytes this connection has transferred */
private int bytesTransferred;
/**
* Creates a new connection between nodes and sets the connection
* state to “up“.
* @param fromNode The node that initiated the connection
* @param toNode The node in the other side of the connection
* @param connectionSpeed Transfer speed of the connection (Bps)
*/
public Connection(DTNHost fromNode DTNHost toNode int connectionSpeed) {
this.fromNode = fromNode;
this.toNode = toNode;
this.speed = connectionSpeed;
this.isUp = true;
this.transferDoneTime = 0;
this.bytesTransferred = 0;
}
/**
* Returns true if the connection is up
* @return state of the connection
*/
public boolean isUp() {
return this.isUp;
}
/**
* Returns true if the given node is the initiator of the connection false
* otherwise
* @param node The node to check
* @return true if the given node is the initiator of the connection
*/
public boolean isInitiator(DTNHost node) {
return node == this.fromNode;
}
/**
* Sets the state of the connection.
* @param state True if the connection is up false if not
*/
public void setUpState(boolean state) {
this.isUp = state;
}
/**
* Sets a message that this connection is currently transferring. If message
* passing is controlled by external events this method is not needed
* (but then e.g. {@link #finalizeTransfer()} and
* {@link #isMessageTransferred()} will not work either). Only a one message
* at a time can be transferred using one connection.
* @param m The message
* @return The value returned by
* {@link MessageRouter#receiveMessage(Message DTNHost)}
*/
public int startTransfer(DTNHost from Message m) {
assert this.msgOnFly == null : “Already transferring “ +
this.msgOnFly + “ from “ + this.msgFromNode + “ to “ +
this.getOtherNode(this.msgFromNode) + “. Can‘t “+
“start transfer of “ + m + “ from “ + from;
this.msgFromNode = from;
Message newMessage = m.replicate();
int retVal = getOtherNode(from).receiveMessage(newMessage from);
if (retVal == MessageRouter.RCV_OK) {
this.msgOnFly = newMessage;
this.transferDoneTime = SimClock.getTime() +
(1.0*m.getSize()) / this.speed;
}
return retVal;
}
/**
* Aborts the transfer of the currently transferred message.
*/
public void abortTransfer() {
assert msgOnFly != null : “No message to abort at “ + msgFromNode;
int bytesRemaining = getRemainingByteCount();
this.bytesTransferred += msgOnFl
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-08-25 19:45 one\
文件 2480 2008-08-25 19:44 one\HISTORY.txt
文件 246 2007-07-19 12:24 one\prophet_settings.txt
目录 0 2008-08-25 19:45 one\test\
文件 5352 2008-08-19 22:21 one\test\ConnectionTest.java
文件 3312 2008-08-19 22:21 one\test\TestUtils.java
文件 1289 2008-08-19 22:21 one\test\WKTPointReaderTest.java
文件 4410 2008-08-19 22:21 one\test\AbstractRouterTest.java
文件 747 2008-08-19 22:21 one\test\CoordTest.java
文件 1222 2008-08-19 22:21 one\test\StationaryMovement.java
文件 3594 2008-08-19 22:21 one\test\MessageChecker.java
文件 6329 2008-08-19 22:21 one\test\PointsOfInterestTest.java
文件 2274 2008-08-19 22:21 one\test\DijkstraPathFinderTest.java
文件 18208 2008-08-19 22:21 one\test\EpidemicRouterTest.java
文件 1921 2008-08-19 22:21 one\test\ExternalMovementReaderTest.java
文件 4382 2007-11-20 23:07 one\test\MaxPropDijkstraTest.java
文件 2181 2008-08-19 22:21 one\test\MapNodeTest.java
文件 9463 2008-04-16 22:07 one\test\MaxPropRouterTest.java
文件 6918 2008-08-19 22:21 one\test\WKTReaderTest.java
文件 4560 2008-08-19 22:21 one\test\ContactTimesReportTest.java
文件 2134 2008-08-19 22:21 one\test\MessageGraphvizReportTest.java
文件 3345 2008-08-19 22:21 one\test\ExternalMovementTest.java
文件 1560 2008-08-19 22:21 one\test\TestSettings.java
文件 5673 2008-08-19 22:21 one\test\SettingsTest.java
文件 1685 2008-08-19 22:21 one\test\ActivenessHandlerTest.java
文件 2278 2008-08-19 22:21 one\test\DistanceDelayReportTest.java
文件 3761 2008-08-19 22:21 one\test\TotalContactTimeReportTest.java
文件 2608 2008-08-19 22:21 one\test\ExternalEventsQueueTest.java
文件 168 2007-07-19 12:24 one\test\package.html
文件 4538 2008-08-19 22:21 one\test\ProphetRouterTest.java
文件 1431 2008-08-19 22:21 one\test\TestDTNHost.java
............此处省略280个文件信息
相关资源
- java银行管理系统(模拟ATM取款机)
- android 仿iphone 滑动开关按钮 switch
- java网上购物结算模拟(介绍了软件的
- (操作系统)睡眠理发师模拟有界面
- java局域网聊天模拟qq
- 计算机操作系统大作业—进程控制模
- Cocuy: The Fluid Simulator 2.1- 2D流体模拟插
- 编程模拟多进程共享临界资源最终版
- 数据库系统原理课程设计实验java模拟
- 用模拟退火算法实现旅行商问题Java
- 单处理器进程调度模拟java实现
- 模拟售票系统程序(完整版)
- 大二上学期初学java之期末课程设计–
- 基于Android的文件管理系统源代码
- 操作系统spooling假脱机技术模拟
- Android仿iPhone滚动控件源码
- java多线程模拟队列实现排队叫号
- 模拟文件系统Java版
- Neo4jDemoNew.rar
- 操作系统大型实验-二级目录文件系统
- java 多线程模拟钟表 首创
- Java页面置换算法模拟程序FIFO、LRU
- 编译原理 电梯模拟程序java版
- WeChatLuckyMoney-5.0.1.zip
- 使用java编写的MIPS模拟器
- Java模拟拼图小游戏
- javafx实现模拟电梯升降
- Java操作系统课设之模拟进程管理系统
- 模拟xp设置时间日期属性界面的JAVA程
- Java Socket 编程模拟Ftp
评论
共有 条评论