diff --git a/src/org/opensha2/calc/CurveValue.java b/src/org/opensha2/calc/CurveValue.java new file mode 100644 index 0000000000000000000000000000000000000000..108874d6c16e88655e10dc3eda824b301aabc4b2 --- /dev/null +++ b/src/org/opensha2/calc/CurveValue.java @@ -0,0 +1,16 @@ +package org.opensha2.calc; + +/** + * Hazard curve value types. + * + * @author Peter Powers + */ +public enum CurveValue { + + /** Annual-rate. */ + ANNUAL_RATE, + + /** Poisson probability. */ + POISSON_PROBABILITY; + +} diff --git a/src/org/opensha2/calc/ThreadCount.java b/src/org/opensha2/calc/ThreadCount.java new file mode 100644 index 0000000000000000000000000000000000000000..eaef8470fec2c89baf5e24aca1a7f9fe5c148614 --- /dev/null +++ b/src/org/opensha2/calc/ThreadCount.java @@ -0,0 +1,38 @@ +package org.opensha2.calc; + +import java.util.concurrent.ExecutorService; + +/** + * The number of threads with which to intialize thread pools. Values reference + * the number of non-competing threads that could be supported on a particular + * system as determined by calling {@link Runtime#availableProcessors()}. + * + * @author Peter Powers + */ +public enum ThreadCount { + + /** + * A single thread. Use of a single thread will generally prevent an + * {@link ExecutorService} from being used, and all calculations will be run + * on the thread from which a program was called. + */ + ONE, + + /** + * Half of {@code ALL}. + */ + HALF, + + /** + * Two less than {@code ALL}. So as to not commandeer all available + * resources. + */ + N_MINUS_2, + + /** + * All possible non-competing threads. The number of threads will equal the + * number of available processors. + */ + ALL; + +}