You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/11/13 21:40:17 UTC
[commons-statistics] branch master updated: Correct triangle distribution example command
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git
The following commit(s) were added to refs/heads/master by this push:
new 427585a Correct triangle distribution example command
427585a is described below
commit 427585ae749edd2fa81274f3e1db4297369c036d
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Nov 13 21:40:00 2022 +0000
Correct triangle distribution example command
---
.../statistics/examples/distribution/TriangularCommand.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/commons-statistics-examples/examples-distribution/src/main/java/org/apache/commons/statistics/examples/distribution/TriangularCommand.java b/commons-statistics-examples/examples-distribution/src/main/java/org/apache/commons/statistics/examples/distribution/TriangularCommand.java
index 65f915d..200a49d 100644
--- a/commons-statistics-examples/examples-distribution/src/main/java/org/apache/commons/statistics/examples/distribution/TriangularCommand.java
+++ b/commons-statistics-examples/examples-distribution/src/main/java/org/apache/commons/statistics/examples/distribution/TriangularCommand.java
@@ -58,16 +58,16 @@ class TriangularCommand extends AbstractDistributionCommand {
private double[] lower = {-4, -1};
/** The distribution mode. */
- @Option(names = {"-b", "--mode"},
- paramLabel = "b",
+ @Option(names = {"-c", "--mode"},
+ paramLabel = "c",
arity = "1..*",
split = ",",
description = {"mode (default: ${DEFAULT-VALUE})."})
private double[] mode = {2.5, 2};
/** The distribution upper limit. */
- @Option(names = {"-c", "--upper"},
- paramLabel = "c",
+ @Option(names = {"-b", "--upper"},
+ paramLabel = "b",
arity = "1..*",
split = ",",
description = {"upper bound (default: ${DEFAULT-VALUE})."})
@@ -98,7 +98,7 @@ class TriangularCommand extends AbstractDistributionCommand {
final ArrayList<Distribution<ContinuousDistribution>> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
final ContinuousDistribution d = TriangularDistribution.of(lower[i], mode[i], upper[i]);
- list.add(new Distribution<>(d, "a=" + lower[i] + ",b=" + upper[i] + ",c=" + upper[i]));
+ list.add(new Distribution<>(d, "a=" + lower[i] + ",b=" + upper[i] + ",c=" + mode[i]));
}
return list;
}