| 1 | = defProperty: Define a Property = |
| 2 | |
| 3 | This command allows the experimenter to define a property which can be bound to other properties as |
| 4 | well as application parameters. The value of a property defined in an experiment script is tracked in |
| 5 | the experiment database. It is also accessible through the nodehandler's web interface. Experimenters are |
| 6 | highly encouraged to use properties for values which define the character of the experiment. This is especially |
| 7 | true for values which change through the course of the experiment. This command will also create a nodehandler command line |
| 8 | parameter of the same name. |
| 9 | |
| 10 | == Syntax: defProperty(name, initialValue, description) == |
| 11 | |
| 12 | * '''name:''' Name of the property. The name will be used in any consecutive ''bindProperty'' as well as ''prop'' commands. |
| 13 | * '''initialValue:''' The initial value of the property. Also determines the type of the property. |
| 14 | * '''description:''' Textual description. Used in nodehandler's help message, as well as for the default web interface. |
| 15 | |
| 16 | == Usage == |
| 17 | |
| 18 | {{{ |
| 19 | defProperty('rate', 300, 'Bits per second sent from sender') |
| 20 | defProperty('packetSize', 1024, 'Size of packets sent from sender') |
| 21 | }}} |
| 22 | |
| 23 | The initial value of an experiment property can be overriden from the command line of the nodehandler. For instance the 'rate', defined above can be set to 1000 as follows: |
| 24 | |
| 25 | {{{ |
| 26 | % nodehandler path:to:script -- --rate 1000 |
| 27 | }}} |
| 28 | |
| 29 | Please note the '--' after the experiment uri which separates the command line parameters of the nodehandler from those of the experiment. |
| 30 | |
| 31 | |
| 32 | == See Also == |
| 33 | |
| 34 | |
| 35 | |