wiki:Old/NodeHandler/Commands/defNodes

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

defNodes: Define Nodes used in Experiment

This command defines a set of nodes used in the experiment. An experiment can contain multiple such declarations.

Syntax: defNodes(setName, selector, &block)

  • setName: Name of the defined set.
  • selector: Selects the nodes contained in this set.
  • block: Instructions for all nodes in the set.

The 'setName' is a simple string which is used in the remander of the experiment script to refer to this set of nodes.

The 'selector' defines which nodes are in the set. A selector can have the following forms:

  • [x,y]: Describes a single node at location x@y
  • [x1..x2, y]: Describes a set of nodes along a line starting at x1@y and ending at x2@y. For instance, [2..4, 5] defines the nodes [2,5], [3,5], [4,5].
  • [x, y1..y2]: Same as previous, but for the y coordinate.
  • [x1..x2, y1..y2]: This defines a rectangle area of nodes within the grid.
  • x1,y1], [x2,y2], [x3,y3: An arbitrary long list of single nodes. Obvioulsy, any entry in this list can also use the line and rectangle descriptions defined above.

Usage

See Also

Note: See TracWiki for help on using the wiki.