Commit 385d07ac authored by Nils Richerzhagen's avatar Nils Richerzhagen
Browse files

Merge branch 'master' into 'nr/master-debug'

Merge master into nr/master-debug



See merge request !25
parents 1275a26c d2558d71
......@@ -599,6 +599,13 @@ public class DefaultConfigurator implements Configurator {
param = paramList;
} else if (typeClass == String[].class) {
param = value.split(CLASS_SEPARATOR);
} else if (typeClass == long[].class) {
String[] vals = value.split(CLASS_SEPARATOR);
long[] lvals = new long[vals.length];
for (int i = 0; i < vals.length; i++) {
lvals[i] = parseNumber(vals[i], Long.class);
}
param = lvals;
} else {
throw new IllegalArgumentException("Parameter type " + typeClass
+ " is not supported");
......@@ -834,15 +841,15 @@ public class DefaultConfigurator implements Configurator {
}
}
// Bandwidth (internally used in bit/s)
else if (value.matches("\\d+(Mbps|Kbps|bps)")) {
if (value.matches("\\d+(bps)")) {
factor = Rate.bit_s;
number = value.substring(0, value.length() - 3);
} else if (value.matches("\\d+(Kbps)")) {
factor = Rate.kbit_s;
number = value.substring(0, value.length() - 4);
} else if (value.matches("\\d+(Mbps)")) {
else if (value.matches("\\d+(Mbits|kbits|bits)")) {
if (value.matches("\\d+(Mbits)")) {
factor = Rate.Mbit_s;
number = value.substring(0, value.length() - 5);
} else if (value.matches("\\d+(kbits)")) {
factor = Rate.kbit_s;
number = value.substring(0, value.length() - 5);
} else if (value.matches("\\d+(bits)")) {
factor = Rate.bit_s;
number = value.substring(0, value.length() - 4);
} else {
throw new IllegalStateException("Invalid bandwidth unit.");
......
......@@ -26,6 +26,10 @@ import de.tudarmstadt.maki.simonstrator.api.Time;
public class AccessPointSegmentDatabase
extends AbstractGridBasedTopologyDatabase {
private long bandwidthUpload = 10 * Rate.Mbit_s;
private long bandwidthDownload = 10 * Rate.Mbit_s;
public AccessPointSegmentDatabase() {
super(100, true);
}
......@@ -33,7 +37,15 @@ public class AccessPointSegmentDatabase
@Override
protected Entry createEntryFor(int segmentID, boolean isCloudlet) {
return new StaticEntry(segmentID, 0, 0, 50 * Time.MILLISECOND,
50 * Time.MILLISECOND, 10 * Rate.Mbit_s, 10 * Rate.Mbit_s);
50 * Time.MILLISECOND, bandwidthUpload, bandwidthDownload);
}
public void setBandwidthUp(long bandwidthUp) {
this.bandwidthUpload = bandwidthUp;
}
public void setBandwidthDown(long bandwidthDown) {
this.bandwidthDownload = bandwidthDown;
}
}
......@@ -95,5 +95,21 @@ public class StaticSegmentDatabase extends AbstractGridBasedTopologyDatabase {
public void setCloudletLatencyVariance(long cloudletLatencyVariance) {
this.cloudletLatencyVariance = cloudletLatencyVariance;
}
public void setBandwidthUp(long bandwidthUp) {
this.bandwidthUpload = bandwidthUp;
}
public void setBandwidthDown(long bandwidthDown) {
this.bandwidthDownload = bandwidthDown;
}
public void setCloudletBandwidthUp(long bandwidthUp) {
this.bandwidthUpload = bandwidthUp;
}
public void setCloudletBandwidthDown(long bandwidthDown) {
this.bandwidthDownload = bandwidthDown;
}
}
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