diff --git a/src/main/java/gov/usgs/earthquake/nshmp/calc/HazardCalcs.java b/src/main/java/gov/usgs/earthquake/nshmp/calc/HazardCalcs.java index 11ad060bb847f8e760fc460d45375001368b787c..3ad3434d9eeed6cde35a5ba192b404defa29e3ef 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/calc/HazardCalcs.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/calc/HazardCalcs.java @@ -141,7 +141,7 @@ public class HazardCalcs { Site site, Executor ex) throws InterruptedException, ExecutionException { - AsyncList<HazardCurveSet> curveSets = AsyncList.createWithCapacity(model.size()); + AsyncList<HazardCurveSet> curveSets = AsyncList.create(); AsyncList<RuptureSet<? extends Source>> gridTables = AsyncList.create(); var settingFilter = model.settingFilter(config, site.location()); var typeFilter = new SourceTypeFilter(config); @@ -209,7 +209,7 @@ public class HazardCalcs { Site site, Logger log) { - List<HazardCurveSet> curveSets = new ArrayList<>(model.size()); + List<HazardCurveSet> curveSets = new ArrayList<>(); var settingsFilter = model.settingFilter(config, site.location()); var typeFilter = new SourceTypeFilter(config); diff --git a/src/main/java/gov/usgs/earthquake/nshmp/model/HazardModel.java b/src/main/java/gov/usgs/earthquake/nshmp/model/HazardModel.java index 98f2003d3f63869675306d050efe9afa6c5ceb51..c89c991bcc2d4d6706499add1a9f55be8f802099 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/model/HazardModel.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/model/HazardModel.java @@ -43,12 +43,13 @@ import gov.usgs.earthquake.nshmp.gmm.NehrpSiteClass; /** * 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 - * {@code HazardModel} contains of a number of {@link RuptureSet}s that define - * logical groupings of sources by {@link SourceType}. Each {@code RuptureSet} - * carries with it references to the {@code GroundMotionModel}s and associated - * weights to be used when evaluating hazard. + * {@code HazardModel} is a List of {@link SourceTree}s that define logical + * trees of sources. The tips of the source logic tree branches are + * {@code RuptureSet}s that carry the necessary information to carries with it + * references to the {@code GroundMotionModel}s and associated weights to be + * used when evaluating hazard. * * @author U.S. Geological Survey * @see Source @@ -87,8 +88,8 @@ public final class HazardModel implements Iterable<SourceTree> { * * <p>For more information on a HazardModel directory and file structure, see * the <a - * href="https://github.com/usgs/nshmp-haz/wiki/Earthquake-Source-Models"> - * nshmp-haz wiki</a>. + * href="https://code.usgs.gov/ghsc/nshmp/nshmp-haz/-/blob/main/docs/pages/Hazard-Model.md"> + * nshmp-haz documentation</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. @@ -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 - return ruptureSetMap.size(); + public int size() { + return idMap.size(); } @Override