Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-lib
Commits
3c4c4974
Commit
3c4c4974
authored
2 years ago
by
Powers, Peter M.
Browse files
Options
Downloads
Patches
Plain Diff
allowing logicGroup branch scale to be zero
parent
20bde955
No related branches found
No related tags found
1 merge request
!277
mfd-tree and text updates
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/gov/usgs/earthquake/nshmp/tree/GroupBranch.java
+2
-2
2 additions, 2 deletions
...main/java/gov/usgs/earthquake/nshmp/tree/GroupBranch.java
src/main/java/gov/usgs/earthquake/nshmp/tree/LogicGroup.java
+3
-2
3 additions, 2 deletions
src/main/java/gov/usgs/earthquake/nshmp/tree/LogicGroup.java
with
5 additions
and
4 deletions
src/main/java/gov/usgs/earthquake/nshmp/tree/GroupBranch.java
+
2
−
2
View file @
3c4c4974
package
gov.usgs.earthquake.nshmp.tree
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
data
.
DoubleData
.
checkIsPositiveAndReal
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
data
.
DoubleData
.
checkIsPositiveAndReal
OrZero
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
tree
.
RegularBranch
.
checkId
;
/**
...
...
@@ -18,7 +18,7 @@ class GroupBranch<T> implements Branch<T> {
GroupBranch
(
String
id
,
T
value
,
double
scale
)
{
this
.
id
=
checkId
(
id
);
this
.
value
=
checkNotNull
(
value
);
this
.
scale
=
checkIsPositiveAndReal
(
scale
);
this
.
scale
=
checkIsPositiveAndReal
OrZero
(
scale
);
}
@Override
...
...
This diff is collapsed.
Click to expand it.
src/main/java/gov/usgs/earthquake/nshmp/tree/LogicGroup.java
+
3
−
2
View file @
3c4c4974
...
...
@@ -15,7 +15,8 @@ import java.util.List;
* implements {@code LogicTree}, its sampling methods are overriden to throw an
* {@code UnsupportedOperationException}. A logic group branch <i>may</i>
* include a scale factor that is used in lieu of a branch weight; in most
* real-world cases, the scale value is one.
* real-world cases, the scale value is one. The scale factor may also be zero
* to represent {@code null} branches.
*
* @param <T> the type of value stored in a branch
* @author U.S. Geological Survey
...
...
@@ -97,7 +98,7 @@ public final class LogicGroup<T> extends AbstractList<Branch<T>> implements Logi
*
* @param id of the branch
* @param value of the branch
* @param scale factor to apply in lieu of a branch weight
* @param scale factor to apply in lieu of a branch weight
, may be zero
* @return this {@code Builder} object
* @throws NullPointerException if {@code id} or {@code value} is null
* @throws IllegalArgumentException if {@code id} is empty or whitespace
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment