[Javanetsim-cvs] javaNetSim/core/protocolsuite/tcp_ip/ospf OSPF.java,1.9,1.10
Status: Beta
Brought to you by:
darkkey
From: Alouette <alo...@us...> - 2006-02-27 17:33:53
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27061/core/protocolsuite/tcp_ip/ospf Modified Files: OSPF.java Log Message: Index: OSPF.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPF.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** OSPF.java 24 Feb 2006 13:05:57 -0000 1.9 --- OSPF.java 27 Feb 2006 17:33:45 -0000 1.10 *************** *** 522,525 **** *this method to receive link statereqiest */ ! } --- 522,596 ---- *this method to receive link statereqiest */ ! ! ! ! ! ! public class SPFtable ! { ! public Vector Operated = new Vector(); // contains vertex, that have been already seen ! public Vector Missed = new Vector(); // vertex, that have not been already seen ! public Vector Pathfinder = new Vector(); // vector conatins all pathes ! SPFtable() ! { ! ! } ! ! ! // declaration element of vector, store path and correct length ! public class PathStorage ! { ! public int PathCost; // path length ! public Vector PathVertex = new Vector(); // vertex correct composing this path ! PathStorage() ! { ! PathCost = 0; ! } ! ! } // End PathStorage ! ! ! public void AddPath(PathStorage toadd) // add element to correct number ! { ! int a; // path cost ! int i=0;// counter ! int flag=0; // flag that element was added ! while ((i<Pathfinder.size()) && (flag==0)) ! { ! if ( (toadd.PathCost) < ((PathStorage)Pathfinder.elementAt(i)).PathCost) //!!! ! { ! Pathfinder.insertElementAt(toadd, i); ! flag=1; ! } ! i++; ! } ! if (flag==0) ! { ! Pathfinder.insertElementAt(toadd, i); ! } ! } ! ! ! ! ! } ! ! public void SPF() ! { ! // start position ! SPFtable solution = new SPFtable(); ! solution.Operated.addElement(this.RouterID); // add to vector router id ! int i=0; ! for (i=0; i<Graf.size(); i++) //add to vector all vertex except current ! { ! if (!((RouterRecord)Graf.elementAt(i)).RouterID.equals(this.RouterID)) ! { ! solution.Missed.addElement(((RouterRecord)Graf.elementAt(i)).RouterID); ! } ! } ! ! // add all path consist of one rib to vector ! // save current order :path with least cost add first ! ! } } |