(详细的)ONE程序安装使用方法.doc

上传人:asd****56 文档编号:70334249 上传时间:2023-01-19 格式:DOC 页数:16 大小:501.50KB
返回 下载 相关 举报
(详细的)ONE程序安装使用方法.doc_第1页
第1页 / 共16页
(详细的)ONE程序安装使用方法.doc_第2页
第2页 / 共16页
点击查看更多>>
资源描述

《(详细的)ONE程序安装使用方法.doc》由会员分享,可在线阅读,更多相关《(详细的)ONE程序安装使用方法.doc(16页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、ONE程序安装使用方法一软件安装1. 安装平台:Windows XP(可以是linux环境,方法类似)2. 所需软件:至少需要:one_1.3.0.zip(windows版)jdk-6u18-windows-i586(jdk1.6)还可以需要:ActivePerl(windows平台perl解释器)Graphviz(用于将程序生成的数据绘图,程序会生成与graphviz兼容的文件)3. 安装步骤:(1) 安装JDK:双击安装JDK,选择任意路径,比如D:Program FilesJavajdk1.6.0_10,后面还要选择JRE路径,比如D:Program FilesJavajre6(2) 注

2、册环境变量:右键点击我的电脑-属性-高级-环境变量系统变量中新建以下三个环境变量及其对应值。 set JAVA_HOME =D:Program FilesJavajdk1.6.0_10set PATH =%JAVA_HOME%bin;%PATH% (中间那个是分号)set CLASSPATH =.;%JAVA_HOME%libtools.jar (最前面是一个点加一个分号) 然后,开始-运行-CMD打开WINDOWS平台的命令行窗口(黑屏窗口),如果在黑屏里输入javac,能够出来一些提示,而不是命令不存在,就说明环境变量注册成功。(3) 编译源代码:假设one程序文件夹的路径为F:one_1

3、.3.0one_1.3.0(注意,用cd命令进入one_1.3.0所在的最下层目录),在WINDOWS平台的命令行窗口中,进入到该目录,如下图所示:输入命令编译程序,命令为compile.bat,如下图所示:(4)执行程序输入命令执行程序,会出现程序图形界面,命令为one.bat,如下图所示:程序运行成功。(5)带参数执行程序:在README.txt中,说明如下:Running-ONE can be started using the included one.bat (for Windows) or one.sh (forLinux/Unix) script. Following examp

4、les assume youre using the Linux/Unixscript (just replace .sh by .bat for Windows).Synopsis:one.sh -b runcount conf-filesOptions: -b Run simulation in batch mode. Doesnt start GUI but printsinformation about the progress to terminal. The option must be followed by the number of runs to perform in th

5、e batch mode or by a range of runs to perform, delimited with a colon (e.g, value 2:4 would perform runs 2, 3 and 4). See section Run indexing for more information. Parameters: conf-files: The configuration file names where simulation parametersare read from. Any number of configuration files can be

6、 defined and they areread in the order given in the command line. Values in the later config files override values in earlier config files.所以应该可以使用one.bat -b runcount conf-files的语法在执行程序的时候指定配置文件和参数,这样才是完整的运行语法。不带参数是指定了默认的配置文件default_settings。二软件使用1.目录介绍:在软件文件夹one_1.3.0内,有几个需要注意的文件夹,说明如下:Reports这个是软件

7、的仿真结果输出文件夹,所有的仿真结果(仿真统计数据、graphviz兼容数据)都将输出在这个文件夹内,如图所示:Report这个是默认的仿真程序将要调用的仿真方法的存放位置。在仿真程序中可以选择不同的仿真方法,比如统计包投递率,统计消息传送时延,或者是统计连接信息。这些方法用java代码写成,成功编译软件后会生成对应的.class的java类,如图所示:Routing这个文件夹里存放的是仿真程序中可用的路由协议,按默认配置程序会在这个文件夹内搜索使用java语言写成的路由协议。Toolkit这个文件夹里存放的是一些辅助性的perl脚本,比如createCreates.pl就是一个手动生成消息的

8、脚本。2.配置文件:软件默认使用名称为default_settings.txt的文件作为配置文件,在该文件中可以配置程序运行的相关参数,其中比较重要的参数包括:路由协议、网络中的消息产生方式,配置文件中关键参数的配置介绍如下:路由协议:可以通过指定Group.router的值指定全网所使用的路由协议,也可以分别指定各个组自己的路由协议,此处要注意使用不同路由协议的节点间可能无法正常通信。设置全网路由协议的部分如下图所示,图中设置全网使用EpidemicRouter这种路由协议(#号为注释):消息产生机制:在仿真程序中,节点之间相互通信的消息,可以通过两种方式产生。一种是使用程序自带的消息产生模

9、块MessageEventGenerator,在仿真过程中产生随机的消息。在这种方式中,可以指定消息的产生速度范围,包大小范围,通信节点范围等,但不能指定具体值,每次仿真过程中产生的消息可能都不一样,无法实现场景再现。MessageEventGenerator的配置如下图所示:上图是第一个消息队列的参数设置,在仿真程序中可以通过改变Events.nrof的取,设定多个消息队列,不同消息队列之间的消息产生是相互独立的,即如果有两个消息队列的话,则可以理解为网络中可能存在同时相互通信的两对节点。在上图中,可以指定消息产生的间隔时间Events1.interval = 15,35,消息(IP包)的大

10、小范围Events1.size = 500k, 1M,消息所属的源/目的节点的地址Events1.hosts = 0,125,以及在仿真结果中用于帮助查看记录的消息所拥有的特有的前缀Events1.prefix = M001。第二种产生消息的方法是使用ExternalEventsQueue消息产生方式。设置如下:Events4.filePath = toolkit/my_Messages.txt指定手工设置的消息文件所在路径,此路径是相对于one程序所在目录的相对路径,Events4.prefix = M004_同样是指定消息前缀。其中,设置中的my_Messages.txt文件可以由tool

11、kit文件夹下的createCreates.pl程序自动生成,也可以手动指定。如果自动生成的话,同样只能生成指定参数范围的随机消息,只有通过手动写入my_Messages.txt文件,才能在仿真过程中使用与预设值完全相同的消息,my_Messages.txt文件格式如下:103.3CM184753652115.0CM298698269121.2CM373547753128.1CM466514476130.8CM574859543133.5CM695564157137.3CM76079634137.8CM890613000143.5CM946645479162.2CM1061569410190.

12、6CM1142734322204.0CM1249479087212.2CM1343773984220.4CM1483555363220.5CM1576517745221.9CM1687976321247.2CM1768972471250.4CM1853581089250.7CM1941874389259.8CM2075556713269.6CM2173632496270.4CM2296746235276.1CM2377709422276.8CM2496676572283.6CM2587698743294.0CM2660852727295.4CM2785696251300.3CM28764029

13、12307.6CM2982594417310.7CM3094896896318.7CM3184549929331.6CM3271802309331.8CM3356682398340.9CM3440918790347.1CM3555508206356.7CM3648433480375.1CM3756492974384.4CM3866558485409.2CM3971917651410.5CM4059729812412.6CM4195963375413.1CM42 55 674738433.1CM43 54953769434.4CM44 8245665439.2CM45 81443960449.1

14、CM46 73788151467.4CM47 7078745470.2CM48 68472281475.0CM49 42982073477.3CM50 83 464029其中第一列表示消息产生时间,第二列unknown。,第三列是消息编号,第四列是源节点编号,第五列是目的节点编号,第六列是消息大小。createCreats.pl脚本的命令如下图所示:通过指定相应的参数,可以生成随机的消息队列,号用于输出重定向,将输出结果写入指定文件,可以通过先使用命令生成格式正确的消息队列文件,再手动修改其中的参数值,得到自己需要的消息队列。3.仿真结果:仿真程序可以统计不同的仿真数据,需要在配置文件中预先设

15、置,如下图所示:Report.nrofReports = 11说明在仿真中需要同时统计11种数据,下面是分别指定统计11种数据所需的仿真方法,仿真方法的名称可以在report文件夹下查到。按此设置,程序运行以后,将会在reports文件夹下生成11个新的文件,分别记录11种统计方式统计出的对应数据。在配置文件中还能指定与节点移动,场景模型等相关的许多参数,其含义在README.txt文件中都有所提及,本文中所使用的配置文件default_settings.txt全文如下所示:# Default settings for the simulation# Scenario settingsScen

16、ario.name = default_scenarioScenario.simulateConnections = trueScenario.updateInterval = 0.1# 43k = 12hScenario.endTime = 43kScenario.nrofHostGroups = 6# Group-specific settings:# groupID : Groups identifier. Used as the prefix of host names# nrofHosts: number of hosts in the group# transmitRange: r

17、ange of the hosts radio devices (meters)# transmitSpeed: transmit speed of the radio devices (bytes per second)# movementModel: movement model of the hosts (valid class name from movement package)# waitTime: minimum and maximum wait times (seconds) after reaching destination# speed: minimum and maxi

18、mum speeds (m/s) when moving on a path# bufferSize: size of the message buffer (bytes)# router: router used to route messages (valid class name from routing package)# activeTimes: Time intervals when the nodes in the group are active (start1, end1, start2, end2, .)# msgTtl : TTL (minutes) of the mes

19、sages created by this host group, default=infinite# Group and movement model specific settings# pois: Points Of Interest indexes and probabilities (poiIndex1, poiProb1, poiIndex2, poiProb2, . ) - for ShortestPathMapBasedMovement# okMaps : which map nodes are OK for the group (map file indexes), defa

20、ult=all - for all MapBasedMovent models# routeFile: routes file path - for MapRouteMovement# routeType: routes type - for MapRouteMovement# common settings for all groupsGroup.movementModel = ShortestPathMapBasedMovement#Group.router = PassiveRouterGroup.router = EpidemicRouterGroup.bufferSize = 5MG

21、roup.transmitRange = 10# transmit speed of 2 Mbps = 250kBpsGroup.transmitSpeed = 250kGroup.waitTime = 0, 120# walking speedsGroup.speed = 0.5, 1.5#Group.msgTtl = 60Group.nrofHosts = 40# group1 (pedestrians) specific settingsGroup1.groupID = p# group2 specific settingsGroup2.groupID = c# cars can dri

22、ve only on roadsGroup2.okMaps = 1# 10-50 km/hGroup2.speed = 2.7, 13.9# another group of pedestriansGroup3.groupID = w# The Tram groupsGroup4.groupID = tGroup4.bufferSize = 50MGroup4.movementModel = MapRouteMovementGroup4.routeFile = data/tram3.wktGroup4.routeType = 1Group4.waitTime = 10, 30Group4.sp

23、eed = 7, 10Group4.nrofHosts = 2Group5.groupID = tGroup5.bufferSize = 50MGroup5.movementModel = MapRouteMovementGroup5.routeFile = data/tram4.wktGroup5.routeType = 2Group5.waitTime = 10, 30Group5.speed = 7, 10Group5.nrofHosts = 2Group6.groupID = tGroup6.bufferSize = 50MGroup6.movementModel = MapRoute

24、MovementGroup6.routeFile = data/tram10.wktGroup6.routeType = 2Group6.waitTime = 10, 30Group6.speed = 7, 10Group6.nrofHosts = 2# Message creation parameters # How many event generatorsEvents.nrof = 4# Class of the first event generatorEvents1.class = MessageEventGenerator# (following settings are spe

25、cific for the MessageEventGenerator class)# Creation interval in seconds (one new message every 25 to 35 seconds)Events1.interval = 15,35# Message sizes (500kB - 1MB)Events1.size = 500k, 1M# range of message source/destination addressesEvents1.hosts = 0,125# Message ID prefixEvents1.prefix = M001# C

26、lass of the first event generatorEvents2.class = MessageEventGenerator# (following settings are specific for the MessageEventGenerator class)# Creation interval in seconds (one new message every 25 to 35 seconds)Events2.interval = 100,300# Message sizes (5MB - 10MB)Events2.size = 5M, 10M# range of m

27、essage source/destination addressesEvents2.hosts = 0,125# Message ID prefixEvents2.prefix = M002# Class of the first event generatorEvents3.class = MessageEventGenerator# (following settings are specific for the MessageEventGenerator class)# Creation interval in seconds (one new message every 25 to

28、35 seconds)Events3.interval = 5,10# Message sizes (500kB - 1MB)Events3.size = 50k, 200k# range of message source/destination addressesEvents3.hosts = 0,125# Message ID prefixEvents3.prefix = M003#self defined messagesEvents4.class = ExternalEventsQueueEvents4.filePath = toolkit/my_Messages.txtEvents

29、4.prefix = M004_# Movement model settings# seed for movement models pseudo random number generator (default = 0)MovementModel.rngSeed = 1# Worlds size for Movement Models without implicit size (width, height; meters)MovementModel.worldSize = 4500, 3400# How long time to move hosts in the world befor

30、e real simulationMovementModel.warmup = 1000# Map based movement -movement model specific settingsMapBasedMovement.nrofMapFiles = 4MapBasedMovement.mapFile1 = data/roads.wktMapBasedMovement.mapFile2 = data/main_roads.wktMapBasedMovement.mapFile3 = data/pedestrian_paths.wktMapBasedMovement.mapFile4 =

31、 data/shops.wkt# Points Of Interest -specific settingsPointsOfInterest.poiFile1 = data/ParkPOIs.wktPointsOfInterest.poiFile2 = data/CentralPOIs.wktPointsOfInterest.poiFile3 = data/WestPOIs.wktPointsOfInterest.poiFile4 = data/shops.wkt# Reports - all report names have to be valid report classes# how

32、many reports to loadReport.nrofReports = 11# length of the warm up period (simulated seconds)Report.warmup = 0# default directory of reports (can be overridden per Report with output setting)Report.reportDir = reports/# Report classes to loadReport.report1 = MessageDeliveryReportReport.report2 = Con

33、tactTimesReportReport.report3 = DeliveredMessagesReportReport.report4 = DistanceDelayReportReport.report5 = ConnectivityDtnsim2ReportReport.report6 = InterContactTimesReportReport.report7 = MessageDelayReportReport.report8 = MessageStatsReportReport.report9 = MovementNs2ReportReport.report10 = Encou

34、ntersVSUniqueEncountersReportReport.report11 = ContactsPerHourReport# Default settings for some routers settingsProphetRouter.secondsInTimeUnit = 30SprayAndWaitRouter.nrofCopies = 6SprayAndWaitRouter.binaryMode = true# Optimization settings - these affect the speed of the simulation# see World class

35、 for details.Optimization.connectionAlg = 2Optimization.cellSizeMult = 5Optimization.randomizeUpdateOrder = true# GUI settings# GUI underlay image settingsGUI.UnderlayImage.fileName = data/helsinki_underlay.png# Image offset in pixels (x, y)GUI.UnderlayImage.offset = 64, 20# Scaling factor for the i

36、mageGUI.UnderlayImage.scale = 4.75# Image rotation (radians)GUI.UnderlayImage.rotate = -0.015# how many events to show in the log panel (default = 30)GUI.EventLogPanel.nrofEvents = 30# Regular Expression log filter (see Pattern-class from the Java API for RE-matching details)#GUI.EventLogPanel.REfilter = .*p1-9p1-9$Eclipsed的安装1双击,建立工作区,如下图:2.新建java项目:新建java项目,在右侧包资源管理器的one_1.4.0上点击右键,选择“属性”,弹出如下对话框,用于添加外部库文件,其中,JRE是系统自带库文件。注意,库文件的添加方法为:先添加one_1.4.0文件夹中的lib文件夹下的库文件(.jar),,再将Eclipse文件件下的两个文件夹复制到one_1.4.0文件夹中的lib文件夹下3.双击要运行的路由协议,点击运行按钮

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 技术资料 > 其他杂项

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com