Skip to content
Snippets Groups Projects
Commit 2e93458e authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

hazard model size cleanup

parent 38e468c4
No related branches found
No related tags found
1 merge request!245Site defaults cleanup
...@@ -141,7 +141,7 @@ public class HazardCalcs { ...@@ -141,7 +141,7 @@ public class HazardCalcs {
Site site, Site site,
Executor ex) throws InterruptedException, ExecutionException { Executor ex) throws InterruptedException, ExecutionException {
AsyncList<HazardCurveSet> curveSets = AsyncList.createWithCapacity(model.size()); AsyncList<HazardCurveSet> curveSets = AsyncList.create();
AsyncList<RuptureSet<? extends Source>> gridTables = AsyncList.create(); AsyncList<RuptureSet<? extends Source>> gridTables = AsyncList.create();
var settingFilter = model.settingFilter(config, site.location()); var settingFilter = model.settingFilter(config, site.location());
var typeFilter = new SourceTypeFilter(config); var typeFilter = new SourceTypeFilter(config);
...@@ -209,7 +209,7 @@ public class HazardCalcs { ...@@ -209,7 +209,7 @@ public class HazardCalcs {
Site site, Site site,
Logger log) { Logger log) {
List<HazardCurveSet> curveSets = new ArrayList<>(model.size()); List<HazardCurveSet> curveSets = new ArrayList<>();
var settingsFilter = model.settingFilter(config, site.location()); var settingsFilter = model.settingFilter(config, site.location());
var typeFilter = new SourceTypeFilter(config); var typeFilter = new SourceTypeFilter(config);
......
...@@ -43,12 +43,13 @@ import gov.usgs.earthquake.nshmp.gmm.NehrpSiteClass; ...@@ -43,12 +43,13 @@ import gov.usgs.earthquake.nshmp.gmm.NehrpSiteClass;
/** /**
* A {@code HazardModel} is the top-level wrapper for earthquake {@link Source} * A {@code HazardModel} is the top-level wrapper for earthquake {@link Source}
* definitions and attendant {@link GroundMotionModel}s used in probabilisitic * definitions and attendant {@link GroundMotionModel}s used in probabilistic
* seismic hazard analyses (PSHAs) and related calculations. A * seismic hazard analyses (PSHAs) and related calculations. A
* {@code HazardModel} contains of a number of {@link RuptureSet}s that define * {@code HazardModel} is a List of {@link SourceTree}s that define logical
* logical groupings of sources by {@link SourceType}. Each {@code RuptureSet} * trees of sources. The tips of the source logic tree branches are
* carries with it references to the {@code GroundMotionModel}s and associated * {@code RuptureSet}s that carry the necessary information to carries with it
* weights to be used when evaluating hazard. * references to the {@code GroundMotionModel}s and associated weights to be
* used when evaluating hazard.
* *
* @author U.S. Geological Survey * @author U.S. Geological Survey
* @see Source * @see Source
...@@ -87,8 +88,8 @@ public final class HazardModel implements Iterable<SourceTree> { ...@@ -87,8 +88,8 @@ public final class HazardModel implements Iterable<SourceTree> {
* *
* <p>For more information on a HazardModel directory and file structure, see * <p>For more information on a HazardModel directory and file structure, see
* the <a * the <a
* href="https://github.com/usgs/nshmp-haz/wiki/Earthquake-Source-Models"> * href="https://code.usgs.gov/ghsc/nshmp/nshmp-haz/-/blob/main/docs/pages/Hazard-Model.md">
* nshmp-haz wiki</a>. * nshmp-haz documentation</a>.
* *
* <p><b>Notes:</b> HazardModel loading is not thread safe. There are also a * <p><b>Notes:</b> HazardModel loading is not thread safe. There are also a
* wide variety of exceptions that may be encountered when loading a model. * wide variety of exceptions that may be encountered when loading a model.
...@@ -103,10 +104,10 @@ public final class HazardModel implements Iterable<SourceTree> { ...@@ -103,10 +104,10 @@ public final class HazardModel implements Iterable<SourceTree> {
} }
/** /**
* The number of {@code RuptureSet}s in this {@code HazardModel}. * The number of {@code SourceTree}s in this model.
*/ */
public int size() { // TODO this should be the number of trees public int size() {
return ruptureSetMap.size(); return idMap.size();
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment