機會網路:ONE學習筆記三:defualt_settings.txt配置檔案解讀
阿新 • • 發佈:2018-12-09
本文參考了 https://www.cnblogs.com/SunSmileCS/archive/2012/12/28/2836927.html
以及https://blog.csdn.net/wb7931021/article/details/41077047
本文屬於學習並做筆記,感謝來自博主的分享,如有侵權請聯絡,定及時刪除。
One中的配置檔案是設定了整個模擬環境的條件,包括以下內容:
1. 想定引數:
1) 想定名稱
2) 是否模擬連線
3) 時間步進
4) 模擬結束時間
2. Interface引數
1) 傳輸速度
2) 傳輸範圍
3. 節點資訊(可以以組為單位對節點進行配置)
1) 移動模型(如隨機走動模型、基於地圖的運動模型);
2) 數量
3) 快取大小
4) 等待時間範圍
5) 移動速度
6) 訊息存活最大時間
4. 路由演算法
下面對default_settings.txt進行分析:
One中的配置檔案是設定了整個模擬環境的條件,包括以下內容: 1. 想定引數: 1) 想定名稱 2) 是否模擬連線 3) 時間步進 4) 模擬結束時間 2. Interface引數 1) 傳輸速度 2) 傳輸範圍 3. 節點資訊(可以以組為單位對節點進行配置) 1) 移動模型(如隨機走動模型、基於地圖的運動模型); 2) 數量 3) 快取大小 4) 等待時間範圍 5) 移動速度 6) 訊息存活最大時間 4. 路由演算法 下面對default_settings.txt進行分析: # # Default settings for the simulation # ## Scenario settings #想定名稱的作用,主要是生成report檔名稱的一部分, #最好每次執行的時候加一個編號,以免模擬結束生成的報告覆蓋上一次結果。 Scenario.name = default_scenario #是否模擬節點連線的動作, #true則GUI介面中節點一直在動,而且會顯示節點間的連線狀況 Scenario.simulateConnections = true #時間步進,單位為s, #ONE是時間驅動模型,通過累加時間片來模擬時間的推進 #另一個比較有名的商業網路模擬器OPNET,則是事件驅動, #事件驅動就是以事件為單位來模擬時間推進的過程。 Scenario.updateInterval = 0.1 # 43200s == 12h #模擬整個過程持續時間 Scenario.endTime = 43200 #interface可以理解為DTN節點上的無線網絡卡, #在模擬器中的功能主要是判斷兩個節點是否連通 #以及連通的傳輸速率,常量和變數都可以。 ## Interface-specific settings: # type : 屬於interface包中的哪個類,直接寫類名稱 # For different types, the sub-parameters are interface-specific # 對於SimpleBroadcastInterface, 引數如下: # transmitSpeed : interface傳輸速率 (位元每秒) # transmitRange : interface傳輸範圍 (米) # "Bluetooth" interface for all nodes btInterface.type = SimpleBroadcastInterface # Transmit speed of 2 Mbps = 250kBps btInterface.transmitSpeed = 250k btInterface.transmitRange = 10 # High speed, long range, interface for group 4 highspeedInterface.type = SimpleBroadcastInterface highspeedInterface.transmitSpeed = 10M highspeedInterface.transmitRange = 1000 # Define 6 different node groups Scenario.nrofHostGroups = 6 ## Group-specific settings: # One中節點的組織是通過組實現的,屬於同一組的所有節點的引數配置一樣 # groupID : Group's identifier. Used as the prefix of host names # 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 # 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 ## 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 = EpidemicOracleRouter Group.bufferSize = 2000M Group.waitTime = 0, 120 # All nodes have the bluetooth interface Group.nrofInterfaces = 1 Group.interface1 = btInterface # Walking speeds Group.speed = 0.5, 1.5 # Message TTL of 300 minutes (5 hours) Group.msgTtl = 300 Group.nrofHosts = 40 # group1 (pedestrians) specific settings Group1.groupID = p # group2 specific settings Group2.groupID = c # cars can drive only on roads Group2.okMaps = 1 # 10-50 km/h Group2.speed = 2.7, 13.9 # another group of pedestrians Group3.groupID = w # The Tram groups Group4.groupID = t #Group4.bufferSize = 1000M Group4.movementModel = ShortestPathMapBasedMovement Group4.routeFile = data/tram3.wkt Group4.routeType = 1 Group4.waitTime = 10, 30 Group4.speed = 7, 10 Group4.nrofHosts = 2 Group4.nrofInterfaces = 2 Group4.interface1 = btInterface Group4.interface2 = highspeedInterface Group5.groupID = t #Group5.bufferSize = 1000M Group5.movementModel = ShortestPathMapBasedMovement Group5.routeFile = data/tram4.wkt Group5.routeType = 2 Group5.waitTime = 10, 30 Group5.speed = 7, 10 Group5.nrofHosts = 2 Group6.groupID = t #Group6.bufferSize = 1000M Group6.movementModel = ShortestPathMapBasedMovement Group6.routeFile = data/tram10.wkt Group6.routeType = 2 Group6.waitTime = 10, 30 Group6.speed = 7, 10 Group6.nrofHosts = 2 ## 訊息生成引數 # 事件發生器數量 Events.nrof = 1 # 事件發生器一的類名 Events1.class = MessageEventGenerator # (following settings are specific for the MessageEventGenerator class) #訊息生成的時間間隔,(在25~35秒之間生成一個訊息) Events1.interval = 25,35 # 訊息大小 (500kB - 1MB) Events1.size = 500k,1M # 訊息源節點和目的節點的地址範圍 #(one中節點的地址就是一個整形數字) Events1.hosts = 0,125 # 訊息ID字首 Events1.prefix = M ## 移動模型的設定 # seed for movement models' pseudo random number generator (default = 0) MovementModel.rngSeed = 1 # World's size for Movement Models without implicit size (width, height; meters) MovementModel.worldSize = 4500, 3400 # How long time to move hosts in the world before real simulation MovementModel.warmup = 1000 ## Map based movement -movement model specific settings MapBasedMovement.nrofMapFiles = 4 MapBasedMovement.mapFile1 = data/roads.wkt 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包中的類名指定 #報告的數量,或者最後需要輸出多少種報告 Report.nrofReports = 5 #啟動時間,或者說從什麼時候開始收集資料 (模擬器的相對時間,單位是秒) Report.warmup = 0 #報告生成的檔案預設存放目錄,相對於ONE原始碼頂級目錄開始 #如果是多次模擬對比結果,需要每一次都修改為不同的目錄,以免被覆蓋 #或者修改最開始的Scenario的名稱 Report.reportDir = reports/ #需要生成哪些報告,每個報告在上面的目錄下生成一個txt檔案。 Report.report1 = MessageStatsReport Report.report2 = MessageDelayReport Report.report3 = MessageDeliveryReport Report.report4 = MessageGraphvizReport Report.report5 = MessageReport ## Default settings for some routers settings ProphetRouter.secondsInTimeUnit = 30 SprayAndWaitRouter.nrofCopies = 6 SprayAndWaitRouter.binaryMode = true ## 優化設定,會影響到模擬的速度 ## 詳細見core.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]$