Changes between Version 1 and Version 2 of Old/Tutorials/HowtoWriteScripts


Ignore:
Timestamp:
Sep 29, 2005, 10:13:03 PM (19 years ago)
Author:
Surya Satyavolu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/Tutorials/HowtoWriteScripts

    v1 v2  
     1[wiki:WikiStart Orbit] > [wiki:Tutorial Tutorial] > Writing Experiment Scripts
    12
    2 
    3 ===== Developing the Script for an Experiment =====
     3== Developing the Script for an Experiment ==
    44A script is used to run an '''ORBIT Radio Grid Testbed''' experiment.  The script contains the configuration of the experiment, specifies its application and operating system software, describes its initialization and any parameters, and describes each phase of its operation.
    55
    6 '''ORBIT Radio Grid Testbed''' 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.  It is a dynamic language supporting closure, that is, a Ruby block can use its original scope information even if the environment in which it was defined would otherwise have disappeared.
     6'''ORBIT Radio Grid Testbed''' 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
    77
    8 An '''ORBIT Radio Grid Testbed''' script therefore is written in Ruby primarily using ORBIT-specific methods.  A brief description or Ruby follows, then information on the ORBIT-specific methods used to define and control an '''ORBIT Radio Grid Testbed''' experiment, then a note on script coding techniques.
    9 
    10 ===== Ruby Resources =====
    11 There are two primary resources for the Ruby programming language.  The first is [http://www.ruby-lang.org the Ruby Web site].  It contains current information on Ruby and a link to download it for free.  The second is an excellent tutorial and reference book, '''Programming Ruby The Pragmatic Programmer's Guide, Second Edition''', Dave Thomas with Chad Fowler and Andy Hunt, Pragmatic Bookshelf, October 2004, ISBN:0-9745140-5-5, 864 pages;  see [http://www.pragmaticprogrammer.com/titles/ruby].
    12 
    13 ===== Ruby =====
    14 Ruby's syntax is similar to other object-oriented languages like Java or C++.  In Ruby everything that is represented is an object, even numbers like 1.  Functions or procedures are termed methods and are called using the name of the object, a period, and the name of the method, e.g., node.prototype.  Methods in ruby are usually small.
    15 
    16 Variables associated with objects are termed properties and are referred to by the name of the object, a period, and the name of the property, e.g., w.essid.  The formatting of ones use of the language is at the discretion of the programmer, but consistency is helpful, especially in the use of indentation and the placement of the opening and closing braces for code blocks.
     8* [wiki:Tutorial/RubyResources Ruby Resources]
     9* [wiki:Tutorial/OrbitRuby ORBIT Specific Ruby Methods]
    1710
    1811===== ORBIT-specific Methods =====