aboutsummaryrefslogtreecommitdiff
path: root/structure/Graph.java
diff options
context:
space:
mode:
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();
}