[brite-users] Patch for DMLExport.java

Juan Rodriguez Hervella jrh@it.uc3m.es
Wed Jun 11 06:37:01 2003


--Boundary-00=_bYw5+9HnQcy78st
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello,

I attach a pacth for "DMLExport.java" that fix some bugs regarding
the generation of the output file for SSFNet.

Basically, I've made a copy of "nodes[]" to avoid reordering the
array inside of "WriteRouter".

Besides, when we're generating the links of an AS in 
"_network.dml" file, we have to  call "WriteRouterEdge()" only 
and only if both the src.ASID and dst.ASID are equal to the
ASID we are writting about.

The last bug I've found is regarding "WriteASNode()" function,
because I think the "(from/to)Interfaces" variable must be generated
using the values of ".getID" (the real nodes) instead of "ASID".

Please tell me what you think of this changes.

Thanks.

-- 
JFRH
--Boundary-00=_bYw5+9HnQcy78st
Content-Type: text/plain;
  charset="us-ascii";
  name="DMLExport.java_patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="DMLExport.java_patch.txt"

*** ../../../tmp/BRITE/Java/Export/DMLExport.java	Wed Apr 24 13:10:48 2002
--- DMLExport.java	Wed Jun 11 12:19:13 2003
***************
*** 150,157 ****
        rtTo = 0;
      }
      
!     int fromInterface = getInterface(ASFrom);
!     int toInterface = getInterface(ASTo);
      
      try {
        mw.write("\tlink [ attach " + ASFrom +":"+rtFrom+"("+fromInterface+") ");
--- 150,157 ----
        rtTo = 0;
      }
      
!     int fromInterface = getInterface(src.getID());
!     int toInterface = getInterface(dst.getID());
      
      try {
        mw.write("\tlink [ attach " + ASFrom +":"+rtFrom+"("+fromInterface+") ");
***************
*** 257,263 ****
  	int srcAS = ((RouterNodeConf)src.getNodeConf()).getCorrAS();
  	int dstAS = ((RouterNodeConf)dst.getNodeConf()).getCorrAS();
  	//write the edge iff atleast one of its end points falls in this AS
! 	if (srcAS==asID || dstAS==asID)
  	  WriteRouterEdge(edges[i]); 
        }
      }
--- 257,263 ----
  	int srcAS = ((RouterNodeConf)src.getNodeConf()).getCorrAS();
  	int dstAS = ((RouterNodeConf)dst.getNodeConf()).getCorrAS();
  	//write the edge iff atleast one of its end points falls in this AS
! 	if ((srcAS==asID) && (dstAS==asID))
  	  WriteRouterEdge(edges[i]); 
        }
      }
***************
*** 349,355 ****
    
  
    private void WriteHier(Graph rtG) {
!     Node[] nodes = rtG.getNodesArray();
      Arrays.sort(nodes, Node.ASIDComparator);
      ArrayList asNodes = new ArrayList();
      int asID = ((RouterNodeConf)nodes[0].getNodeConf()).getCorrAS();
--- 349,357 ----
    
  
    private void WriteHier(Graph rtG) {
!     Node[] nodes_aux = rtG.getNodesArray();
!     Node[] nodes = new Node[nodes_aux.length];
!     System.arraycopy( nodes_aux, 0, nodes, 0, nodes_aux.length );
      Arrays.sort(nodes, Node.ASIDComparator);
      ArrayList asNodes = new ArrayList();
      int asID = ((RouterNodeConf)nodes[0].getNodeConf()).getCorrAS();

--Boundary-00=_bYw5+9HnQcy78st--