55 lines
1.3 KiB
Java
55 lines
1.3 KiB
Java
package main;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.Set;
|
|
|
|
import org.graphstream.graph.Edge;
|
|
import org.graphstream.graph.Graph;
|
|
import org.graphstream.graph.implementations.SingleGraph;
|
|
import org.graphstream.ui.layout.springbox.EdgeSpring;
|
|
import org.graphstream.ui.swingViewer.basicRenderer.EdgeRenderer;
|
|
import org.graphstream.ui.util.EdgePoints;
|
|
|
|
import structure.Grid;
|
|
import structure.MyGraph;
|
|
import structure.Router;
|
|
|
|
public class Main {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
//Grid g=new Grid(Grid.Protocol.AODV);
|
|
|
|
|
|
// Build Graph for graphstream
|
|
//MyGraph gr=new MyGraph("Routage Oportuniste", g);
|
|
//gr.display();
|
|
//gr.update();
|
|
|
|
for(int j=0;j<20;j++){
|
|
Grid g=new Grid(Grid.Protocol.AODV);
|
|
Grid g2=new Grid(Grid.Protocol.DSDV);
|
|
Grid g3=new Grid(Grid.Protocol.CUSTOM);
|
|
|
|
// Update Graph
|
|
for(int i=0;i<100;i++){
|
|
/*try {
|
|
Thread.sleep(10000);
|
|
} catch (InterruptedException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}*/
|
|
g.buildEdgeWithRandomWeigth();
|
|
g2.buildEdgeWithRandomWeigth();
|
|
g3.buildEdgeWithRandomWeigth();
|
|
|
|
//System.out.println("Update !");
|
|
//gr.update();
|
|
}
|
|
|
|
System.out.println("AODV :"+g.getDebitMoy() + " DSDV :"+g2.getDebitMoy()+" CUSTOM :"+g3.getDebitMoy());
|
|
}
|
|
}
|
|
}
|