Changes between Version 40 and Version 41 of Tutorials/a0Basic/Tutorial2


Ignore:
Timestamp:
May 24, 2019, 5:50:24 PM (5 years ago)
Author:
nilanjan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/a0Basic/Tutorial2

    v40 v41  
    1616# Tutorial experiment
    1717#
     18defProperty('res1', 'omf.nicta.node1', "ID of sender node")
     19defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
    1820defProperty('duration', 60, "Duration of the experiment")
    1921
    20 baseTopo = Topology['system:topo:imaged']
    21 
    22 st = defTopology("sender") do |t|
    23   t.addNode(baseTopo.getNodeByIndex(0))
    24 end
    25 
    26 rt = defTopology("receiver") do |t|
    27   t.addNode(baseTopo.getNodeByIndex(1))
    28 end
    29  
    3022defGroup('Sender', "sender") do |node|
    3123  node.addApplication("test:app:otg2") do |app|
     
    7163As 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.
    7264
    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{{{
     68defProperty('res1', 'omf.nicta.node1', "ID of sender node")
     69defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
    7670defProperty('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 end
    83 
    84 rt = defTopology("receiver") do |t|
    85   t.addNode(baseTopo.getNodeByIndex(1))
    86 end
    8771}}}
    8872
     
    230214'''Congratulations''' you just ran your first experiment script on the Orbit Testbed!
    231215
    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]
    233216
    234217=== Beyond the Basics ===
    235218
    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:
     219As 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.