aboutsummaryrefslogtreecommitdiff
path: root/structure/Graph.java
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-21 20:44:25 +0100
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-21 20:44:25 +0100
commitac6de0d3bed1d9849addf0ffd8700721fa8d7580 (patch)
tree7a544624a29159df3f45681897600cbf60381ccb /structure/Graph.java
parent3443b5b3367da1a31be4f594fda9c58abbbca605 (diff)
Add DSDV and AODV
Diffstat (limited to 'structure/Graph.java')
-rw-r--r--structure/Graph.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/structure/Graph.java b/structure/Graph.java
index fde99f8..b1c786d 100644
--- a/structure/Graph.java
+++ b/structure/Graph.java
@@ -16,6 +16,9 @@ public class MyGraph extends SingleGraph{
private Grid grid;
+ private int miss=0;
+ private int success=0;
+
public MyGraph(String title, Grid grid) {
super(title);
// Allow CSS on view
@@ -92,7 +95,7 @@ public class MyGraph extends SingleGraph{
}
public void showBestLink(){
- ArrayList<Integer> bestLink=this.grid.getLinks().get(this.grid.getBestLinkIndex());
+ ArrayList<Integer> bestLink=this.grid.getLinks().get(this.grid.getBestLinkByProtocol());
for(int i=0;i<bestLink.size();i++){
Iterator<Node> nodes= this.getNodeIterator();
while(nodes.hasNext()){
@@ -144,6 +147,14 @@ public class MyGraph extends SingleGraph{
}
+ if(this.grid.getBestLinkByProtocol()==this.grid.getBestLinkIndex()){
+ this.success++;
+ }
+ else{
+ this.miss++;
+ }
+ System.out.println("Success = " + this.success + " Miss = " + this.miss);
+
//Build bestLink
this.showBestLink();
}