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:
-
use-Miracle
-
create-M_Node
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.
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.
This method adds a module into the M_Node. It has three input parameters:
-
layer The number of the layer where the module has to be placed
-
module The instance of the module which has to be plugged
-
ClDepth The maximum depth of the ClMessage which can be traced
It returns an id which is unique inside the given layer.
This method adds a plugin into the M_Node. It has two input parameters:
-
plugin The instance of the plugin which has to be plugged
-
ClDepth The max depth of the ClMessage which can be traced
It returns an id which is unique among the Plugins.
This method insert a Position instance into the M_Node. It has only one input parameters, that is the instance of the Postion object.
This method connects a module of the M_Node to a channel. It has four input parameters:
-
channel Instance of the channel at which the module has to be connect
-
layer The number of the layer where the above module is
-
module The id of the module in the given layer (which is returned by the addModule method)
-
trace If 0 the packets which come from the module and go to the channel an viceversa, will not be traced. If 1 the packets will be traced
This method returns the instance of the Position object of the M_Node.
This method notifies the build of a connection between two modules which are in two adjacent layer. It has four input parameters:
-
layer The number of the layer where the upper module is (it must be grater than 1)
-
upModule The id of the upper module in the layer (which is returned by the addModule method)
-
downModule The id of the lower module in the layer (which is returned by the addModule method)
-
trace If 0 the packets will not be traced, otherwise, if 1, the packets will be traced
Generated on Wed Nov 26 15:47:47 2008 for NS-MIRACLE library by
1.5.2