Changes between Version 40 and Version 41 of Tutorials/a0Basic/Tutorial2
- Timestamp:
- May 24, 2019, 5:50:24 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorials/a0Basic/Tutorial2
v40 v41 16 16 # Tutorial experiment 17 17 # 18 defProperty('res1', 'omf.nicta.node1', "ID of sender node") 19 defProperty('res2', 'omf.nicta.node2', "ID of receiver node") 18 20 defProperty('duration', 60, "Duration of the experiment") 19 21 20 baseTopo = Topology['system:topo:imaged']21 22 st = defTopology("sender") do |t|23 t.addNode(baseTopo.getNodeByIndex(0))24 end25 26 rt = defTopology("receiver") do |t|27 t.addNode(baseTopo.getNodeByIndex(1))28 end29 30 22 defGroup('Sender', "sender") do |node| 31 23 node.addApplication("test:app:otg2") do |app| … … 71 63 As you noticed the "Hello World" script is almost ''human-readable'', and is quite understandable to any computer-literate reader. As already mentioned above, deep Ruby knowledge is '''not''' a prerequisite to running experiments on the ORBIT testbed. 72 64 73 * This portion of the script establishes a few parameters to control the experiment behavior. In particular the ''defProperty'' function call establishes a ''duration'' property for the experiment. The baseTopo variable is set to a Topology object which has collected names of nodes from the 'system:topo:imaged' set, which was established during your last imaging (omf load) operation. Using the defTopology function we define two topolgies names "sender" and "receiver". The baseTopo object's getNodeByIndex will return a node name from the 'system:topo:imaged' set. 74 75 {{{ 65 * This portion of the script establishes a few parameters to control the experiment behavior. In particular the ''defProperty'' function call establishes a ''duration'' property for the experiment. Similarly parameters are also defined for the sender and receiver nodes. 66 67 {{{ 68 defProperty('res1', 'omf.nicta.node1', "ID of sender node") 69 defProperty('res2', 'omf.nicta.node2', "ID of receiver node") 76 70 defProperty('duration', 60, "Duration of the experiment") 77 78 baseTopo = Topology['system:topo:imaged']79 80 st = defTopology("sender") do |t|81 t.addNode(baseTopo.getNodeByIndex(0))82 end83 84 rt = defTopology("receiver") do |t|85 t.addNode(baseTopo.getNodeByIndex(1))86 end87 71 }}} 88 72 … … 230 214 '''Congratulations''' you just ran your first experiment script on the Orbit Testbed! 231 215 232 You will find information on how to collect and interpret measurements and results from your experiment in the next parts of this basic tutorial, [wiki:Tutorials/CollectMeasurements here] and [wiki:Tutorials/AnalyzeResults here]233 216 234 217 === Beyond the Basics === 235 218 236 As mentioned previously, ORBIT experiment scripts are written in Ruby, an easily understood, extensible, dynamic, object-oriented scripting language. Ruby has been extended into the testbed user's domain with a number of methods. Besides its extensibility and object-orientation, Ruby is concise and consistent. An ORBIT script therefore is written in Ruby primarily using ORBIT-specific methods. Users are encouraged to take look at following resources:219 As mentioned previously, ORBIT experiment scripts are written in Ruby, an easily understood, extensible, dynamic, object-oriented scripting language. Ruby has been extended into the testbed user's domain with a number of methods. Besides its extensibility and object-orientation, Ruby is concise and consistent. An ORBIT script therefore is written in Ruby primarily using ORBIT-specific methods.