routage-optimiste/main/Main.java

56 lines
1.3 KiB
Java
Raw Normal View History

2016-02-23 13:34:10 +01:00
package main;
2016-03-18 11:16:47 +01:00
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
2016-03-21 15:40:39 +01:00
import org.graphstream.graph.Edge;
2016-03-14 20:30:30 +01:00
import org.graphstream.graph.Graph;
import org.graphstream.graph.implementations.SingleGraph;
2016-03-21 17:28:53 +01:00
import org.graphstream.ui.layout.springbox.EdgeSpring;
import org.graphstream.ui.swingViewer.basicRenderer.EdgeRenderer;
import org.graphstream.ui.util.EdgePoints;
2016-03-14 20:30:30 +01:00
2016-03-14 18:02:24 +01:00
import structure.Grid;
2016-03-21 17:28:53 +01:00
import structure.MyGraph;
2016-03-18 11:16:47 +01:00
import structure.Router;
2016-03-14 16:35:31 +01:00
2016-02-23 13:34:10 +01:00
public class Main {
public static void main(String[] args) {
2016-03-29 10:46:36 +02:00
2016-04-04 12:01:54 +02:00
//Grid g=new Grid(Grid.Protocol.AODV);
2016-03-29 10:46:36 +02:00
2016-03-21 13:06:19 +01:00
2016-03-22 10:49:04 +01:00
// Build Graph for graphstream
2016-04-04 12:01:54 +02:00
//MyGraph gr=new MyGraph("Routage Oportuniste", g);
//gr.display();
2016-03-29 11:42:05 +02:00
//gr.update();
2016-04-04 12:01:54 +02:00
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();
2016-03-21 18:02:31 +01:00
}
2016-04-04 12:01:54 +02:00
System.out.println("AODV :"+g.getDebitMoy() + " DSDV :"+g2.getDebitMoy()+" CUSTOM :"+g3.getDebitMoy());
2016-03-29 11:42:05 +02:00
}
2016-02-23 13:34:10 +01:00
}
}