This commit is contained in:
manzerbredes 2016-04-04 12:01:54 +02:00
parent 996c9fc346
commit 313c51b76b
4 changed files with 62 additions and 40 deletions

View file

@ -20,27 +20,36 @@ public class Main {
public static void main(String[] args) {
Grid g=new Grid(Grid.Protocol.DSDV);
//Grid g=new Grid(Grid.Protocol.AODV);
// Build Graph for graphstream
MyGraph gr=new MyGraph("Routage Oportuniste", g);
gr.display();
//MyGraph gr=new MyGraph("Routage Oportuniste", g);
//gr.display();
//gr.update();
// Update Graph
while(true){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
g.buildEdgeWithRandomWeigth();
System.out.println("Update !");
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());
}
}
}