diff options
Diffstat (limited to 'main')
| -rw-r--r-- | main/Main.java | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/main/Main.java b/main/Main.java index c9bdd24..3023069 100644 --- a/main/Main.java +++ b/main/Main.java @@ -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(); + 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(); } - g.buildEdgeWithRandomWeigth(); - System.out.println("Update !"); - gr.update(); + + System.out.println("AODV :"+g.getDebitMoy() + " DSDV :"+g2.getDebitMoy()+" CUSTOM :"+g3.getDebitMoy()); } - } } |
