wiki:Old/NodeHandler/Commands/defProperty

Version 1 (modified by max, 19 years ago) ( diff )

defProperty: Define a Property

This command allows the experimenter to define a property which can be bound to other properties as well as application parameters. The value of a property defined in an experiment script is tracked in the experiment database. It is also accessible through the nodehandler's web interface. Experimenters are highly encouraged to use properties for values which define the character of the experiment. This is especially true for values which change through the course of the experiment. This command will also create a nodehandler command line parameter of the same name.

Syntax: defProperty(name, initialValue, description)

  • name: Name of the property. The name will be used in any consecutive bindProperty as well as prop commands.
  • initialValue: The initial value of the property. Also determines the type of the property.
  • description: Textual description. Used in nodehandler's help message, as well as for the default web interface.

Usage

defProperty('rate', 300, 'Bits per second sent from sender')
defProperty('packetSize', 1024, 'Size of packets sent from sender')

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:

% nodehandler path:to:script -- --rate 1000

Please note the '—' after the experiment uri which separates the command line parameters of the nodehandler from those of the experiment.

See Also

Note: See TracWiki for help on using the wiki.