机会网络仿真模拟软件ONE:配置文件settings的解读

机会网络仿真模拟软件ONE:配置文件settings的解读

仿真环境为:the-one 1.6.0,配置文件为:default_settings.txt

注意:ONE是一款基于JAVA语言开发的移动机会网络模拟器

One中的配置文件是设置了整个仿真环境的条件,包括以下内容:
1. 想定参数:
  1) 想定名称
  2) 是否模拟连接
  3) 时间步进
  4) 仿真结束时间
2. Interface参数
  1) 传输速度
  2) 传输范围
3. 节点信息(可以以组为单位对节点进行配置)
  1) 移动模型(如随机走动模型、基于地图的运动模型);
  2) 数量
  3) 缓存大小
  4) 等待时间范围
  5) 移动速度
  6) 消息存活最大时间
4. 路由算法

#
# Default settings for the simulation
#

## Scenario settings     
##设置场景名称,主要是生成report文件名称的一部分
##最好每次运行的时候,都加上一个编号,以免仿真结束生成的报告覆盖上一次的结果
Scenario.name = default_scenario   当前模拟的名称
Scenario.simulateConnections = true  是否模拟节点连接的动作,true则GUI界面中节点一直在动,而且会显示节点间的连接状况
##时间为步进,单位为s
##ONE是时间驱动模型,通过累加时间片来模拟时间的推进
Scenario.updateInterval = 0.1   决定messageRouter.java中的Update函数多久被执行一次,即为场景更新的时间
# 43200s == 12h
##仿真的整个过程持续的时间
Scenario.endTime = 10000000   设置仿真结束时间,单位为秒,默认为12H
Scenario.endTime = 43200

接口可以理解为DTN节点上的无线网卡,在仿真器中的功能主要是判断两个节点是否连通,以及连通的传输速率,常量和变量都可以
## Interface-specific settings:    特定接口设置
# type : which interface class the interface belongs to    类型:接口属于interface包的哪个接口类,直接写类名称
# For different types, the sub-parameters are interface-specific  对于不同的类型,子参数时特定于子接口的
# For SimpleBroadcastInterface, the parameters are:   对于简单的广播接口,参数有:
# transmitSpeed : transmit speed of the interface (bytes per second)   接口的传输速度(bts)
# transmitRange : range of the interface (meters)    接口的传输范围(m)

# "Bluetooth" interface for all nodes   设置节点接口的类型:广播
btInterface.type = SimpleBroadcastInterface    
# Transmit speed of 2 Mbps = 250kBps   设置接口传输速率为250KB/s
btInterface.transmitSpeed = 250k
btInterface.transmitRange = 10    设置接口的传输范围为10m

# High speed, long range, interface for group 4   对于第4组节点设置高速,大范围的通信接口
highspeedInterface.type = SimpleBroadcastInterface
highspeedInterface.transmitSpeed = 10M
highspeedInterface.transmitRange = 10

# Define 6 different node groups  设置场景中包含6个节点组
Scenario.nrofHostGroups = 6

## Group-specific settings:   组的设置,one中的节点的组织是通过组来实现的,属于同一组的所有节点的参数设置是一样的
# groupID : Group's identifier. Used as the prefix of host names  组ID:组的标识符,用于节点名的前缀
# nrofHosts: number of hosts in the group  组当中的主机数量
# 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 maximum speeds (m/s) when moving on a path  速度:最小和最大速度(m/s)当在路径上移动时
# 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 messages created by this host group, default=infinite   TTL是IP协议包的一个值,告诉路由器包在网络中的时间是否太长而应该被丢弃

## 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), default=all 
#          for all MapBasedMovent models  
# routeFile: route's file path - for MapRouteMovement   路线的文件路径
# routeType: route's type - for MapRouteMovement  路由类型

当仿真场景中设计多个组,那么可以设置所有组都默认的设置,然后在具体每个组根据自己的特点进行设置,这样的设计可以简化节点配置
# Common settings for all groups  对于所有组的共同设置
Group.movementModel = ShortestPathMapBasedMovement  设置所有组的移动模型为基于地图的最短路径移动模型
Group.router = EpidemicRouter  设置所有组采用的是Epidemic路由模式,设置采用的路由协议
Group.bufferSize = 5M  设置所有组的缓冲大小

Group.waitTime = 0, 120  设置所有组的等待时间为0-120
# All nodes have the bluetooth interface    
Group.nrofInterfaces = 1  设置所有组一共有几个接口,1为仅有一个接口,Bluetooth为蓝牙接口
Group.interface1 = btInterface  设置所有组的接口1为蓝牙接口
# Walking speeds   
Group.speed = 0.5, 1.5  设置所有组的移动速度为0.5-1.5m/s
# Message TTL of 300 minutes (5 hours)
Group.msgTtl = 300   设置所有组发送出的数据分组的生存周期为300分钟

Group.nrofHosts = 40    设置每组有40个节点

# group1 (pedestrians) specific settings  对不同的分组进行不同的设置,设置第一组为行人p
Group1.groupID = p  设置第一组的ID编号为p

# group2 specific settings  对不同的分组进行设置,设置第二组
Group2.groupID = c   设置第二组的ID编号为c。即为car
# cars can drive only on roads  
Group2.okMaps = 1  设置第二组只能在道路上移动
# 10-50 km/h
Group2.speed = 2.7, 13.9  设置第二组的移动速度为2.7-13.9m/s

# another group of pedestrians
Group3.groupID = w  设置第三组为行人,编号ID为w

# The Tram groups
Group4.groupID = t   设置第四组为电车组,编号ID为t
Group4.bufferSize = 50M   设置第四组的缓冲空间的大小为50M
Group4.movementModel = MapRouteMovement   设置第四组的移动模型为模拟了基于地图的,且预先确定路径的移动方式
Group4.routeFile = data/tram3.wkt   设置第四组的路由文件存放在目录data/tram3.wkt下
Group4.routeType = 1   设置第四组的路由类型为1   (针对MapRouteMovement移动模型 value=1为圆形,value=2为乒乓来回型)
Group4.waitTime = 10, 30   设置第四组的等待时间为10-30秒
Group4.speed = 7, 10   设置第四组的运行速度为7-10m/s
Group4.nrofHosts = 2   设置第四组有两个节点
Group4.nrofInterfaces = 2   设置第四组有两个接口,一个是蓝牙接口,一个是高速接口
Group4.interface1 = btInterface
Group4.interface2 = highspeedInterface

Group5.groupID = t   设置第五组的ID为t,也为电车
Group5.bufferSize = 50M   设置第五组的缓冲空间的大小为50M
Group5.movementModel = MapRouteMovement   设置第五组的移动模型为模拟了基于地图的,且预先确定路径的移动方式
Group5.routeFile = data/tram4.wkt    设置第五组的路由文件存放在目录data/tram4.wkt下
Group5.routeType = 2   设置第五组的路由类型为2
Group5.waitTime = 10, 30   设置第五组的等待时间为10-30秒
Group5.speed = 7, 10   设置第五组的运行速度为7-10m/s
Group5.nrofHosts = 2   设置第五组有两个节点

Group6.groupID = t   设置第六组的ID为t,也为电车
Group6.bufferSize = 50M    设置第六组的缓冲空间的大小为50M
Group6.movementModel = MapRouteMovement  设置第六组的移动模型为模拟了基于地图的,且预先确定路径的移动方式
Group6.routeFile = data/tram10.wkt    设置第六组的路由文件存放在目录data/tram4.wkt下
Group6.routeType = 2    设置第六组的路由类型为2
Group6.waitTime = 10, 30   设置第六组的等待时间为10-30秒
Group6.speed = 7, 10   设置第六组的运行速度为7-10m/s
Group6.nrofHosts = 2   设置第六组有两个节点

##消息生成参数
## Message creation parameters   
# How many event generators   有多少个事件产生器
Events.nrof = 1   设置每个节点的事件产生器的数量为1
# Class of the first event generator   
Events1.class = MessageEventGenerator   Events1的事件类型为消息事件产生器
# (following settings are specific for the MessageEventGenerator class)
# Creation interval in seconds (one new message every 25 to 35 seconds)
Events1.interval = 25,35   Events1事件生成消息的时间间隔,每25-35秒发生一次
# Message sizes (500kB - 1MB) 
Events1.size = 500k,1M  该事件生成数据分组的大小是500kb/s-1MB,在此范围内随机产生
# range of message source/destination addresses  
Events1.hosts = 0,125   (消息源/目的地址的范围)Events1对应的节点代码,第一个节点的编号是从0开始,一直到第126个节点,都遵守此事件
# Message ID prefix 
Events1.prefix = M   Events1产生的数据分组前缀为M


##移动模型的设置
## Movement model settings  
# seed for movement models' pseudo random number generator (default = 0)
MovementModel.rngSeed = 1  使用随机方式的移动模型是通过伪随机函数生成的,其种子值为1(默认为0)
# World's size for Movement Models without implicit size (width, height; meters)
MovementModel.worldSize = 4500, 3400   设置移动模型的边界值,宽为4500m,高为3400m
# How long time to move hosts in the world before real simulation
MovementModel.warmup = 1000   仿真热身时间设置,仿真开始时,容易产生失真,放弃前1000s的数据

##基于地图的移动模型的2级参数设置,涉及4个地图文件
## Map based movement -movement model specific settings
MapBasedMovement.nrofMapFiles = 4  

MapBasedMovement.mapFile1 = data/roads.wkt   地图文件都放在data文件夹下
MapBasedMovement.mapFile2 = data/main_roads.wkt
MapBasedMovement.mapFile3 = data/pedestrian_paths.wkt
MapBasedMovement.mapFile4 = data/shops.wkt

##报告的设置
## Reports - all report names have to be valid report classes   所有报告都是在report包中的类名指定
# how many reports to load  
#报告的数量,或者最后需要输出多少种报告,可以设置想要得到的报告的数量
Report.nrofReports = 2   
# length of the warm up period (simulated seconds)  
#报告的热身时间为0秒(从什么时候开始收集数据)
Report.warmup = 0   
# default directory of reports (can be overridden per Report with output setting)
#报告生成的文件默认的存放位置,相对于ONE源码顶级目录开始
#如果是多次仿真对比结果,需要每次都修改为不同的目录,以免被覆盖
#或者修改最开始的Scenario名称
Report.reportDir = reports/   
# Report classes to load   
#指定需要生成哪些报告,报告的类型---可以添加想要的报告类型,每个报告在上面的目录下生成一个txt文件
Report.report1 = ContactTimesReport   信息统计报告
Report.report2 = ConnectivityONEReport   接触时间报告


##对路由的默认设置
## Default settings for some routers settings 
ProphetRouter.beta = 0.25              默认值为0.25     
ProphetRouter.secondsInTimeUnit = 30   多少秒更新一次(age)
SprayAndWaitRouter.nrofCopies = 6  SprayAndWait路由协议的消息的份数
SprayAndWaitRouter.binaryMode = true   true为一半一半地分,false为一份一份的分
MaxPropRouter.alpha = 1.0            # 默认值为1.0
MaxPropRouter.probSetMaxSize = 50    # 默认值为50

##优化设置,会影响到仿真的速度
## Optimization settings -- these affect the speed of the simulation
## see World class for details.  具体查看World类的细节
Optimization.cellSizeMult = 5
Optimization.randomizeUpdateOrder = true


## GUI settings  界面设置

# GUI underlay image settings
GUI.UnderlayImage.fileName = data/helsinki_underlay.png
# Image offset in pixels (x, y)
GUI.UnderlayImage.offset = 64, 20
# Scaling factor for the image
GUI.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 = 100
# Regular Expression log filter (see Pattern-class from the Java API for RE-matching details)
#GUI.EventLogPanel.REfilter = .*p[1-9]<->p[1-9]$

本篇博客到此结束!

  • 7
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xiaoxiaoqin@

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值