Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
3482b45b
Commit
3482b45b
authored
Nov 25, 2019
by
Daniel Lehmberg
Browse files
minor: more checks on min/max
parent
c3a171ed
Pipeline
#182567
failed with stages
in 1 minute and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereUtils/src/org/vadere/util/math/TruncatedNormalDistribution.java
View file @
3482b45b
...
...
@@ -15,8 +15,12 @@ public class TruncatedNormalDistribution extends NormalDistribution {
public
TruncatedNormalDistribution
(
RandomGenerator
rng
,
double
mean
,
double
standardDeviation
,
double
min
,
double
max
,
int
maxIterations
)
{
super
(
rng
,
mean
,
standardDeviation
);
if
(
max
<=
min
)
throw
new
IllegalArgumentException
(
"Parameter min must be less than bound."
);
if
(
min
<
0
||
max
<=
0
||
max
<=
min
){
// min == 0 does not make to much sense either, but we allow this case for pedestrians that do not move
throw
new
IllegalArgumentException
(
"Parameters 'min' and 'max' must be non-negative and 'min < max'."
);
}
this
.
min
=
min
;
this
.
max
=
max
;
this
.
maxIterations
=
maxIterations
;
...
...
Write
Preview
Supports
Markdown
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