Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
385d07ac
Commit
385d07ac
authored
Nov 26, 2015
by
Nils Richerzhagen
Browse files
Merge branch 'master' into 'nr/master-debug'
Merge master into nr/master-debug See merge request !25
parents
1275a26c
d2558d71
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/scenario/DefaultConfigurator.java
View file @
385d07ac
...
...
@@ -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."
);
...
...
src/de/tud/kom/p2psim/impl/topology/views/fiveg/AccessPointSegmentDatabase.java
View file @
385d07ac
...
...
@@ -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
;
}
}
src/de/tud/kom/p2psim/impl/topology/views/fiveg/StaticSegmentDatabase.java
View file @
385d07ac
...
...
@@ -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
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment