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
e006046f
Commit
e006046f
authored
2 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
Add total mfd
parent
66a535cf
No related branches found
No related tags found
1 merge request
!288
Resolves - Add total MFD for source tree to Models serialization classes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/gov/usgs/earthquake/nshmp/model/Models.java
+5
-1
5 additions, 1 deletion
src/main/java/gov/usgs/earthquake/nshmp/model/Models.java
src/main/java/gov/usgs/earthquake/nshmp/model/RuptureSet.java
+7
-6
7 additions, 6 deletions
...main/java/gov/usgs/earthquake/nshmp/model/RuptureSet.java
with
12 additions
and
7 deletions
src/main/java/gov/usgs/earthquake/nshmp/model/Models.java
+
5
−
1
View file @
e006046f
...
...
@@ -15,7 +15,9 @@ import java.util.stream.Collectors;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
gov.usgs.earthquake.nshmp.data.XySequence
;
import
gov.usgs.earthquake.nshmp.mfd.Mfd
;
import
gov.usgs.earthquake.nshmp.mfd.Mfds
;
import
gov.usgs.earthquake.nshmp.model.SourceTree.Leaf
;
import
gov.usgs.earthquake.nshmp.tree.Branch
;
...
...
@@ -70,7 +72,6 @@ public class Models {
// System.out.println(GSON.toJson(tree(model, 2591))); // Stonewall Ant.
System
.
out
.
println
(
GSON
.
toJson
(
tree
(
model
,
2535
)));
// Steens
}
/**
...
...
@@ -156,6 +157,7 @@ public class Models {
final
String
path
;
final
TectonicSetting
setting
;
final
SourceType
type
;
final
XySequence
totalMfd
;
final
List
<
SourceBranch
>
branches
;
Tree
(
SourceTree
tree
,
Path
modelRoot
)
{
...
...
@@ -164,6 +166,8 @@ public class Models {
this
.
path
=
modelRoot
.
relativize
(
tree
.
path
()).
toString
();
this
.
setting
=
tree
.
setting
();
this
.
type
=
tree
.
type
();
this
.
totalMfd
=
Mfds
.
combine
(
tree
.
stream
().
map
(
branch
->
branch
.
value
().
totalMfd
())
.
collect
(
Collectors
.
toList
())).
data
();
List
<
SourceBranch
>
branches
=
new
ArrayList
<>();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/gov/usgs/earthquake/nshmp/model/RuptureSet.java
+
7
−
6
View file @
e006046f
...
...
@@ -16,6 +16,13 @@ import gov.usgs.earthquake.nshmp.tree.LogicTree;
*/
public
interface
RuptureSet
<
T
extends
Source
>
extends
Iterable
<
T
>
{
/**
* Return the total Mfd.
*/
default
Mfd
totalMfd
()
{
return
ModelTrees
.
reduceMfdTree
(
mfdTree
());
};
/**
* The display name of the rupture set.
*/
...
...
@@ -97,12 +104,6 @@ public interface RuptureSet<T extends Source> extends Iterable<T> {
*/
Predicate
<
T
>
distanceFilter
(
Location
loc
,
double
distance
);
/**
* Return the total
* @return
*/
// Mfd mfd();
// instead of Source
// interface .Model
...
...
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