aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/Main.java8
-rw-r--r--structure/Grid.java8
2 files changed, 8 insertions, 8 deletions
diff --git a/main/Main.java b/main/Main.java
index 0fea318..c9bdd24 100644
--- a/main/Main.java
+++ b/main/Main.java
@@ -20,14 +20,14 @@ public class Main {
public static void main(String[] args) {
- Grid g=new Grid(Grid.Protocol.AODV);
+ Grid g=new Grid(Grid.Protocol.DSDV);
// Build Graph for graphstream
MyGraph gr=new MyGraph("Routage Oportuniste", g);
gr.display();
- gr.update();
- /*
+ //gr.update();
+
// Update Graph
while(true){
@@ -40,7 +40,7 @@ public class Main {
g.buildEdgeWithRandomWeigth();
System.out.println("Update !");
gr.update();
- }*/
+ }
}
}
diff --git a/structure/Grid.java b/structure/Grid.java
index 00c3b52..73c034e 100644
--- a/structure/Grid.java
+++ b/structure/Grid.java
@@ -37,7 +37,8 @@ public class Grid {
this.buildEdgeWithRandomWeigth();
-
+ //Build fixed link
+ this.buildPath();
this.protocol=protocol;
@@ -48,7 +49,7 @@ public class Grid {
case DSDV:
case CUSTOM:
HashMap<Integer,Integer> currentBestLink=new HashMap<>();
- for(int i=0;i<100000;i++){
+ for(int i=0;i<1000;i++){
int current=this.getBestLinkIndex();
if(currentBestLink.containsKey(current)){
currentBestLink.put(current, currentBestLink.get(current)+1);
@@ -87,8 +88,7 @@ public class Grid {
public void buildEdgeWithRandomWeigth(){
- //Build fixed link
- this.buildPath();
+