Commit aa5a15ae authored by Björn Richerzhagen's avatar Björn Richerzhagen
Browse files

Minor visualization tweaks

parent 88fe42d9
...@@ -338,9 +338,9 @@ public class VisualizationTopologyView extends JFrame implements TopologyView, ...@@ -338,9 +338,9 @@ public class VisualizationTopologyView extends JFrame implements TopologyView,
g2.setColor(Color.WHITE); g2.setColor(Color.WHITE);
g2.fillRect(0, 0, VisualizationInjector.getWorldX(), g2.fillRect(0, 0, VisualizationInjector.getWorldX(),
VisualizationInjector.getWorldY()); VisualizationInjector.getWorldY());
g2.setPaint(Color.BLACK); g2.setPaint(Color.MAGENTA);
g2.drawString("100 meters", 10, 15); g2.setStroke(new BasicStroke(2));
g2.drawLine(10, 30, 10 + VisualizationInjector.scaleValue(100), 30); g2.drawLine(0, 0, VisualizationInjector.scaleValue(100), 0);
} }
} }
......
...@@ -20,32 +20,20 @@ ...@@ -20,32 +20,20 @@
package de.tud.kom.p2psim.impl.topology.views.fiveg; package de.tud.kom.p2psim.impl.topology.views.fiveg;
import de.tudarmstadt.maki.simonstrator.api.Rate;
import de.tudarmstadt.maki.simonstrator.api.Time; import de.tudarmstadt.maki.simonstrator.api.Time;
public class AccessPointSegmentDatabase public class AccessPointSegmentDatabase
extends AbstractGridBasedTopologyDatabase { extends AbstractGridBasedTopologyDatabase {
public AccessPointSegmentDatabase() { public AccessPointSegmentDatabase() {
super(50, true); super(100, true);
} }
@Override @Override
protected Entry createEntryFor(int segmentID, boolean isCloudlet) { protected Entry createEntryFor(int segmentID, boolean isCloudlet) {
if (segmentID == 105) { return new StaticEntry(segmentID, 0, 0, 50 * Time.MILLISECOND,
/* 50 * Time.MILLISECOND, 10 * Rate.Mbit_s, 10 * Rate.Mbit_s);
* FIXME just testing
*/
return new StaticEntry(segmentID, 0, 0, 10 * Time.MILLISECOND,
10 * Time.MILLISECOND, 1000000, 1000000);
}
if (segmentID == 240) {
/*
* FIXME just testing
*/
return new StaticEntry(segmentID, 0, 0, 38 * Time.MILLISECOND,
38 * Time.MILLISECOND, 1000000, 1000000);
}
return null;
} }
} }
...@@ -35,6 +35,7 @@ import de.tud.kom.p2psim.impl.topology.views.FiveGTopologyView; ...@@ -35,6 +35,7 @@ import de.tud.kom.p2psim.impl.topology.views.FiveGTopologyView;
import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector; import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector;
import de.tud.kom.p2psim.impl.topology.views.fiveg.AbstractGridBasedTopologyDatabase; import de.tud.kom.p2psim.impl.topology.views.fiveg.AbstractGridBasedTopologyDatabase;
import de.tud.kom.p2psim.impl.topology.views.fiveg.FiveGTopologyDatabase.Entry; import de.tud.kom.p2psim.impl.topology.views.fiveg.FiveGTopologyDatabase.Entry;
import de.tudarmstadt.maki.simonstrator.api.Rate;
import de.tudarmstadt.maki.simonstrator.api.Time; import de.tudarmstadt.maki.simonstrator.api.Time;
/** /**
...@@ -146,13 +147,17 @@ public class FiveGVisualization extends JComponent { ...@@ -146,13 +147,17 @@ public class FiveGVisualization extends JComponent {
g2.setStroke(new BasicStroke( g2.setStroke(new BasicStroke(
(float) (10 * entry.getDropProbability(isUpload)))); (float) (10 * entry.getDropProbability(isUpload))));
g2.drawRect(x, y, stepSize, stepSize); g2.drawRect(x, y, stepSize, stepSize);
g2.setColor(new Color(0, 0, 0, 100)); g2.setColor(new Color(255, 255, 255, 255));
g2.drawString("L: "
+ entry.getLatency(isUpload) / Time.MILLISECOND + " ms",
x + 10, y + 15);
g2.drawString( g2.drawString(
"L: " + entry.getLatency(isUpload) / Time.MILLISECOND, "D: " + (int) (entry.getDropProbability(isUpload) * 100)
x + 10, y + 10); + " %",
g2.drawString("D: "
+ (int) (entry.getDropProbability(isUpload) * 100),
x + 10, y + 25); x + 10, y + 25);
g2.drawString("BW: "
+ (int) (entry.getBandwidth(isUpload) / Rate.kbit_s)
+ " kBit/s", x + 10, y + 35);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment