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 {
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);
......
......@@ -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
......
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