www.pudn.com > 3.rar > test.ned, change:2004-03-23,size:2134b


  //-----------------------------------------------
  // default components:
  //-----------------------------------------------

    simple application
      gates:
        in:  lowergate_in, uppergate_in, blackboard_in;
        out: lowergate_out, uppergate_out;
    endsimple

    simple layer0
      gates:
        in:  lowergate_in[], uppergate_in, blackboard_in;
        out: lowergate_out[], uppergate_out;
    endsimple


  //-----------------------------------------------
  // sensor node definition:
  //-----------------------------------------------

    module sensornode
      parameters:
	    CNNCTVTY,
		KIND,COLOR,
		PX,PY;

	  gates:
        in: 	in[];
        out:	out[];
      submodules:
        sm_layer0:	layer0;
		  gatesizes: lowergate_in[CNNCTVTY], lowergate_out[CNNCTVTY];
		  display: "p=110,450;b=200,50,rect;i=layer0";
        sm_application:	application;
		  display: "p=110,30;b=200,40,rect;i=application";
        connections nocheck:
      	for i=0..CNNCTVTY-1 do
          in[i]   --> sm_layer0.lowergate_in[i];
          out[i] <--  sm_layer0.lowergate_out[i];
        endfor
      	sm_application.lowergate_in  <--  sm_layer0.uppergate_out;
      	sm_application.lowergate_out  --> sm_layer0.uppergate_in;
	  display: "b=290,485,rect;o=white";
     endmodule

  // the central manager
  simple manager
    parameters:
	  P_FMAP,N_FMAP;
    gates:
      in: in;
      out: out;
  endsimple

//-------------------------------------------------
// the parent module
//-------------------------------------------------
module test
  parameters: 
    MAXCONN,NNODES,SSTRENGTH;
  submodules:
    snode:	sensornode[NNODES]
	  parameters:
	    CNNCTVTY	= MAXCONN,
		KIND		= 2,
		COLOR		= 2,
		PX			= 0,
		PY			= 0;
      gatesizes: in[MAXCONN],out[MAXCONN];
    man:		manager
	  parameters:
		P_FMAP		= 0,
		N_FMAP		= 0; 
  connections nocheck:
  display: "p=0,0;b=860,560,rect;o=white";
endmodule

//-------------------------------------------------
// the network
//-------------------------------------------------
network thetest : test
endnetwork
//-------------------------------------------------