test
This commit is contained in:
parent
996c9fc346
commit
313c51b76b
4 changed files with 62 additions and 40 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue