close Warning: Can't synchronize with repository "(default)" (/common/SVN/wimax does not appear to be a Subversion repository.). Look in the Trac log for more information.

WiMAX/30/07: gec13-tut01.rb

File gec13-tut01.rb, 1.8 KB (added by Nilanjan Paul, 9 years ago)
Line 
1defProperty('res1', "node1-1.outdoor.orbit-lab.org", "ID of node 1")
2defProperty('res2', "node1-2.outdoor.orbit-lab.org", "ID of node 2")
3
4defGroup('first_node', property.res1) do |node|
5 node.net.x0.profile = '51'
6 node.addApplication("test:app:wimaxcu_app") do |app|
7 app.measure('status_link')
8 end
9end
10
11defGroup('second_node', property.res2) do |node|
12 node.net.x0.profile = '51'
13 node.addApplication("test:app:wimaxcu_app") do |app|
14 app.measure('status_link')
15 end
16end
17
18
19onEvent(:ALL_UP_AND_INSTALLED) do |event|
20 wait 10
21 allGroups.startApplications
22 wait 50
23 allGroups.stopApplications
24 Experiment.done
25end
26
27addTab(:defaults)
28addTab(:graph2) do |tab|
29 opts = { :postfix => %{This graph shows the Received Signal Strength (RSSI) on the WiMAX link.}, :updateEvery => 1 }
30 tab.addGraph("WiMAX Downlink RSSI (dBm)", opts) do |g|
31 data = Hash.new
32 index = 1
33 mpIn = ms('status_link')
34 mpIn.project(:oml_ts_server, :oml_sender_id, :rssi).each do |sample|
35 time, src, rssi = sample.tuple
36 if data[src].nil?
37 data[src] = [index,[]]
38 index += 1
39 end
40 data[src][1] << [time, rssi]
41 end
42 data.each do |src,value|
43 g.addLine(value[1], :label => "#{value[0]}")
44 end
45 end
46 opts = { :postfix => %{This graph shows the Carrier-to-Interference+Noise Ratio (CINR) on the WiMAX link.}, :updateEvery => 1 }
47 tab.addGraph("WiMAX Downlink CINR (dB)", opts) do |g|
48 data = Hash.new
49 index = 1
50 mpIn = ms('status_link')
51 mpIn.project(:oml_ts_server, :oml_sender_id, :cinr).each do |sample|
52 time, src, rssi = sample.tuple
53 if data[src].nil?
54 data[src] = [index,[]]
55 index += 1
56 end
57 data[src][1] << [time, rssi]
58 end
59 data.each do |src,value|
60 g.addLine(value[1], :label => "#{value[0]}")
61 end
62 end
63end
64