Tcl Interface

Introduction

When this library is loaded in the simulator (with the Tcl command 'load'), it adds some Tcl commands in order to create your scenario. In this section we will describe these commands.

First af all, two methods are added to the Simulator object:

The use-Miracle method must be invoked before begin to use any functionalities of this library. It initializes some internal variables and it does not have input parameter.

The create-M_Node returns an instance of a M_Node (we describe this class in the follow). It has an input parameter, i.e. the number of layers which can be made in this node.

A N_Node instance (which is returned by the create-M_node method) is similar to a box, in which all the modules are inserted. Modules normally represent items in the protocol stack, and therefore can be connected among themselves (with the method setConnection). In the follow we describe the class M_Node and its methods and properties.

The class M_Node

This is a pure Tcl class (i.e., it does not have a C++ implementation) used to contain all the modules which can be plugged in the simulation nodes.

addModule

This method adds a module into the M_Node. It has three input parameters: It returns an id which is unique inside the given layer.

addPlugin

This method adds a plugin into the M_Node. It has two input parameters: It returns an id which is unique among the Plugins.

addPosition

This method insert a Position instance into the M_Node. It has only one input parameters, that is the instance of the Postion object.

addToChannel

This method connects a module of the M_Node to a channel. It has four input parameters:

position

This method returns the instance of the Position object of the M_Node.

setConnection

This method notifies the build of a connection between two modules which are in two adjacent layer. It has four input parameters:
Generated on Wed Nov 26 15:47:47 2008 for NS-MIRACLE library by  doxygen 1.5.2