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
9dcb8a5e
Commit
9dcb8a5e
authored
Nov 26, 2015
by
Nils Richerzhagen
Browse files
Added insanity checks to MaxPeerCount churn generator.
parent
385d07ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/churn/MaxPeerCountChurnGenerator.java
View file @
9dcb8a5e
...
...
@@ -79,6 +79,8 @@ public class MaxPeerCountChurnGenerator
private
final
String
SEP
=
","
;
private
final
long
_minBurstLength
=
10
*
Time
.
MINUTE
;
private
final
int
maxNumberOfNodes
;
/**
* {@link ChurnInfo} from the csv file.
...
...
@@ -99,8 +101,9 @@ public class MaxPeerCountChurnGenerator
}
};
@XMLConfigurableConstructor
({
"file"
})
public
MaxPeerCountChurnGenerator
(
String
file
)
{
@XMLConfigurableConstructor
({
"file"
,
"maxNumberOfNodes"
})
public
MaxPeerCountChurnGenerator
(
String
file
,
int
maxNumberOfNodes
)
{
this
.
maxNumberOfNodes
=
maxNumberOfNodes
;
parseTrace
(
file
);
}
...
...
@@ -330,6 +333,10 @@ public class MaxPeerCountChurnGenerator
assert
burstLength
>=
_minBurstLength
:
"The minimal length of the burst must be at least 10m."
;
assert
numberOfClients
>
0
:
"Number of nodes must be positive."
;
assert
numberOfClients
<=
maxNumberOfNodes
:
"Cannot configure more nodes than configured in configuration."
;
previousEndTime
=
startTime
+
burstLength
;
churnInfos
.
add
(
new
ChurnInfo
(
startTime
,
burstLength
,
...
...
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