zoukankan      html  css  js  c++  java
  • One网络模拟器探索之三:配置文件

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

    下面对default_settings.txt进行分析:

    View Code
      1 #
      2 # Default settings for the simulation
      3 #
      4 
      5 ## Scenario settings
      6 #想定名称的作用,主要是生成report文件名称的一部分,
      7 #最好每次运行的时候加一个编号,以免仿真结束生成的报告覆盖上一次结果。
      8 Scenario.name = default_scenario
      9 
     10 #是否模拟节点连接的动作,
     11 #true则GUI界面中节点一直在动,而且会显示节点间的连接状况
     12 Scenario.simulateConnections = true
     13 
     14 #时间步进,单位为s,
     15 #ONE是时间驱动模型,通过累加时间片来模拟时间的推进
     16 #另一个比较有名的商业网络仿真器OPNET,则是事件驱动,
     17 #事件驱动就是以事件为单位来模拟时间推进的过程。
     18 Scenario.updateInterval = 0.1
     19 
     20 # 43200s == 12h
     21 #仿真整个过程持续时间
     22 Scenario.endTime = 43200
     23 
     24 #interface可以理解为DTN节点上的无线网卡,
     25 #在仿真器中的功能主要是判断两个节点是否连通
     26 #以及连通的传输速率,常量和变量都可以。
     27 ## Interface-specific settings:
     28 # type : 属于interface包中的哪个类,直接写类名称
     29 # For different types, the sub-parameters are interface-specific
     30 # 对于SimpleBroadcastInterface, 参数如下:
     31 # transmitSpeed : interface传输速率 (比特每秒) 
     32 # transmitRange : interface传输范围 (米)
     33 
     34 # "Bluetooth" interface for all nodes
     35 btInterface.type = SimpleBroadcastInterface
     36 # Transmit speed of 2 Mbps = 250kBps
     37 btInterface.transmitSpeed = 250k
     38 btInterface.transmitRange = 10
     39 
     40 # High speed, long range, interface for group 4
     41 highspeedInterface.type = SimpleBroadcastInterface
     42 highspeedInterface.transmitSpeed = 10M
     43 highspeedInterface.transmitRange = 1000
     44 
     45 # Define 6 different node groups
     46 Scenario.nrofHostGroups = 6
     47 
     48 ## Group-specific settings:
     49 # One中节点的组织是通过组实现的,属于同一组的所有节点的参数配置一样
     50 # groupID : Group's identifier. Used as the prefix of host names
     51 # nrofHosts: number of hosts in the group
     52 # movementModel: movement model of the hosts (valid class name from movement package)
     53 # waitTime: minimum and maximum wait times (seconds) after reaching destination
     54 # speed: minimum and maximum speeds (m/s) when moving on a path
     55 # bufferSize: size of the message buffer (bytes)
     56 # router: router used to route messages (valid class name from routing package)
     57 # activeTimes: Time intervals when the nodes in the group are active (start1, end1, start2, end2, ...)
     58 # msgTtl : TTL (minutes) of the messages created by this host group, default=infinite
     59 
     60 ## Group and movement model specific settings
     61 # pois: Points Of Interest indexes and probabilities (poiIndex1, poiProb1, poiIndex2, poiProb2, ... )
     62 #       for ShortestPathMapBasedMovement
     63 # okMaps : which map nodes are OK for the group (map file indexes), default=all 
     64 #          for all MapBasedMovent models
     65 # routeFile: route's file path - for MapRouteMovement
     66 # routeType: route's type - for MapRouteMovement
     67 
     68 #当仿真场景中涉及到多个组,那么可以设置所有组都默认的设置
     69 #然后在具体每个组再根据自己的特点进行设置,这样的设计可以简化节点配置
     70 # Common settings for all groups
     71 Group.movementModel = ShortestPathMapBasedMovement
     72 Group.router = EpidemicOracleRouter
     73 Group.bufferSize = 2000M
     74 Group.waitTime = 0, 120
     75 # All nodes have the bluetooth interface
     76 Group.nrofInterfaces = 1
     77 Group.interface1 = btInterface
     78 # Walking speeds
     79 Group.speed = 0.5, 1.5
     80 # Message TTL of 300 minutes (5 hours)
     81 Group.msgTtl = 300
     82 
     83 Group.nrofHosts = 40
     84 
     85 # group1 (pedestrians) specific settings
     86 Group1.groupID = p
     87 
     88 # group2 specific settings
     89 Group2.groupID = c
     90 # cars can drive only on roads
     91 Group2.okMaps = 1
     92 # 10-50 km/h
     93 Group2.speed = 2.7, 13.9
     94 
     95 # another group of pedestrians
     96 Group3.groupID = w
     97 
     98 # The Tram groups
     99 Group4.groupID = t
    100 #Group4.bufferSize = 1000M
    101 Group4.movementModel = ShortestPathMapBasedMovement
    102 Group4.routeFile = data/tram3.wkt
    103 Group4.routeType = 1
    104 Group4.waitTime = 10, 30
    105 Group4.speed = 7, 10
    106 Group4.nrofHosts = 2
    107 Group4.nrofInterfaces = 2
    108 Group4.interface1 = btInterface
    109 Group4.interface2 = highspeedInterface
    110 
    111 Group5.groupID = t
    112 #Group5.bufferSize = 1000M
    113 Group5.movementModel = ShortestPathMapBasedMovement
    114 Group5.routeFile = data/tram4.wkt
    115 Group5.routeType = 2
    116 Group5.waitTime = 10, 30
    117 Group5.speed = 7, 10
    118 Group5.nrofHosts = 2
    119 
    120 Group6.groupID = t
    121 #Group6.bufferSize = 1000M
    122 Group6.movementModel = ShortestPathMapBasedMovement
    123 Group6.routeFile = data/tram10.wkt
    124 Group6.routeType = 2
    125 Group6.waitTime = 10, 30
    126 Group6.speed = 7, 10
    127 Group6.nrofHosts = 2
    128 
    129 
    130 ## 消息生成参数
    131 # 事件发生器数量
    132 Events.nrof = 1
    133 # 事件发生器一的类名
    134 Events1.class = MessageEventGenerator
    135 # (following settings are specific for the MessageEventGenerator class)
    136 #消息生成的时间间隔,(在25~35秒之间生成一个消息)
    137 Events1.interval = 25,35
    138 # 消息大小 (500kB - 1MB)
    139 Events1.size = 500k,1M
    140 # 消息源节点和目的节点的地址范围
    141 #(one中节点的地址就是一个整形数字)
    142 Events1.hosts = 0,125
    143 # 消息ID前缀
    144 Events1.prefix = M
    145 
    146 
    147 ## 移动模型的设置
    148 # seed for movement models' pseudo random number generator (default = 0)
    149 MovementModel.rngSeed = 1
    150 # World's size for Movement Models without implicit size (width, height; meters)
    151 MovementModel.worldSize = 4500, 3400
    152 # How long time to move hosts in the world before real simulation
    153 MovementModel.warmup = 1000
    154 
    155 ## Map based movement -movement model specific settings
    156 MapBasedMovement.nrofMapFiles = 4
    157 
    158 MapBasedMovement.mapFile1 = data/roads.wkt
    159 MapBasedMovement.mapFile2 = data/main_roads.wkt
    160 MapBasedMovement.mapFile3 = data/pedestrian_paths.wkt
    161 MapBasedMovement.mapFile4 = data/shops.wkt
    162 
    163 ## Reports - all report names have to be valid report classes
    164 #所有报告都是在report包中的类名指定
    165 #报告的数量,或者最后需要输出多少种报告
    166 Report.nrofReports = 5
    167 #启动时间,或者说从什么时候开始收集数据 (模拟器的相对时间,单位是秒)
    168 Report.warmup = 0
    169 #报告生成的文件默认存放目录,相对于ONE源码顶级目录开始
    170 #如果是多次仿真对比结果,需要每一次都修改为不同的目录,以免被覆盖
    171 #或者修改最开始的Scenario的名称
    172 Report.reportDir = reports/
    173 #需要生成哪些报告,每个报告在上面的目录下生成一个txt文件。
    174 Report.report1 = MessageStatsReport
    175 Report.report2 = MessageDelayReport
    176 Report.report3 = MessageDeliveryReport
    177 Report.report4 = MessageGraphvizReport
    178 Report.report5 = MessageReport
    179 
    180 
    181 ## Default settings for some routers settings
    182 ProphetRouter.secondsInTimeUnit = 30
    183 SprayAndWaitRouter.nrofCopies = 6
    184 SprayAndWaitRouter.binaryMode = true
    185 
    186 ## 优化设置,会影响到仿真的速度
    187 ## 详细见core.world类 
    188 Optimization.cellSizeMult = 5
    189 Optimization.randomizeUpdateOrder = true
    190 
    191 
    192 #界面设置
    193 ## GUI settings
    194 
    195 # GUI underlay image settings
    196 GUI.UnderlayImage.fileName = data/helsinki_underlay.png
    197 # Image offset in pixels (x, y)
    198 GUI.UnderlayImage.offset = 64, 20
    199 # Scaling factor for the image
    200 GUI.UnderlayImage.scale = 4.75
    201 # Image rotation (radians)
    202 GUI.UnderlayImage.rotate = -0.015
    203 
    204 # how many events to show in the log panel (default = 30)
    205 GUI.EventLogPanel.nrofEvents = 100
    206 # Regular Expression log filter (see Pattern-class from the Java API for RE-matching details)
    207 #GUI.EventLogPanel.REfilter = .*p[1-9]<->p[1-9]$

     

     

     

    Top
    收藏
    关注
    评论
  • 相关阅读:
    c_str()函数
    Linux创建用户
    Linux vim替换命令
    计算器表达式求值源码
    结构体、共用体。面试必用
    Ubuntu打开中文输入法
    Unable to establish SSL connection
    变量的命名和使用
    C++ ARX二次开发-MFC 非模态对话框modaless dialog
    C++ ARX二次开发-创建三维实体
  • 原文地址:https://www.cnblogs.com/SunSmileCS/p/2836927.html
Copyright © 2011-2022 走看看