org.opensha.sha.earthquake
Class ProbEqkSource

java.lang.Object
  extended by org.opensha.sha.earthquake.ProbEqkSource
All Implemented Interfaces:
Serializable, Iterable<ProbEqkRupture>, Named, EqkSource
Direct Known Subclasses:
CEUS_Point2Vert_FaultPoisSource, ClusterSource, CyberShakeProbEqkSource, FaultRuptureSource, FaultSource, FloatingPoissonFaultSource, Frankel02_TypeB_EqkSource, Frankel96_CharEqkSource, Frankel96_GR_EqkSource, GriddedRegionPoissonEqkSource, Point2MultVertSS_FaultSource, Point2Vert_FaultPoisSource, Point2Vert_SS_FaultPoisSource, PointEqkSource, PointSource, PointSource13, PointSource13b, PointToLineSource, PointToLineSource_old, UnsegmentedSource, WG02_CharEqkSource

public abstract class ProbEqkSource
extends Object
implements EqkSource, Named, Iterable<ProbEqkRupture>

Title: ProbEqkSource

Description: Class for Probabilistic earthquake source. Note that the tectonicRegionType must be one of the options given by the TYPE_* options in the class org.opensha.sha.imr.param.OtherParams.TectonicRegionTypeParam, and the default here is the TYPE_ACTIVE_SHALLOW option in that class. Subclasses must override this in the constructor, or users can change the value using the setTectonicRegion() method here.

Version:
1.0
Author:
Ned Field, Nitin Gupta, Vipin Gupta
See Also:
Serialized Form

Field Summary
protected  boolean isPoissonian
          This boolean tells whether the source is Poissonian, which will influence the calculation sequence in the HazardCurveCalculator.
protected  String name
          Name of this class
 
Constructor Summary
ProbEqkSource()
           
 
Method Summary
 double computeApproxTotalProbAbove(double mag, Region region)
          This computes the Approx total probability of all ruptures great than or equal to the given mangitude.
 double computeEquivTotalMomentRate(double duration)
          this computes the Poisson equivalent total moment rate of the source
 double computeTotalEquivMeanAnnualRate(double duration)
          This computes the equivalent mean annual rate for this source (a sum of the rates of all the ruptures)
 double computeTotalProb()
          This computes the total probability for this source (a sum of the probabilities of all the ruptures)
 double computeTotalProbAbove(double mag)
          This computes the total probability of all rutures great than or equal to the given mangitude
 double computeTotalProbAbove(double mag, Region region)
          This computes the total probability of all rutures great than or equal to the given mangitude
 ArrayList<Integer> drawRandomEqkRuptureIndices()
          This draws a random list of rupture indices.
 ArrayList<ProbEqkRupture> drawRandomEqkRuptures()
          This draws a random list of ruptures.
 int drawSingleRandomEqkRuptureIndex()
          This draws a single rupture index based on the relative probabilities.
 String getInfo()
          Get the info for this source
abstract  double getMinDistance(Site site)
          This computes some measure of the minimum distance between the source and the site passed in.
 String getName()
          get the name of this class
abstract  int getNumRuptures()
          Get the number of ruptures for this source
abstract  ProbEqkRupture getRupture(int nRupture)
          Get the ith rupture for this source This is a handle(or reference) to existing class variable.
 ProbEqkRupture getRuptureClone(int nRupture)
          this function can be used if a clone is wanted instead of handle to class variable Subsequent calls to this function will not affect the result got previously.
 List<ProbEqkRupture> getRuptureList()
          Returns the ArrayList consisting of all ruptures for this source all the objects are cloned.
 Iterator<ProbEqkRupture> getRupturesIterator()
          Get the iterator over all ruptures This function returns the iterator for the rupturelist after calling the method getRuptureList()
 String getSourceMetadata()
          Returns the Source Metadata.
 TectonicRegionType getTectonicRegionType()
          This gets the TectonicRegionType for this source
 boolean isPoissonianSource()
          Checks if the source is Poission.
 boolean isSourcePoissonian()
          This method tells whether the source is Poissonian, which will influence the calculation sequence in the HazardCurveCalculator
 Iterator<ProbEqkRupture> iterator()
           
 void setInfo(String infoString)
          Set the info for this Prob Eqk source
 void setTectonicRegionType(TectonicRegionType tectonicRegionType)
          This allows one to change the default tectonic-region type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensha.sha.earthquake.EqkSource
getAllSourceLocs, getSourceSurface
 

Field Detail

name

protected String name
Name of this class


isPoissonian

protected boolean isPoissonian
This boolean tells whether the source is Poissonian, which will influence the calculation sequence in the HazardCurveCalculator. Note that the default value is true, so non-Poissonian sources will need to overide this value.

Constructor Detail

ProbEqkSource

public ProbEqkSource()
Method Detail

isSourcePoissonian

public boolean isSourcePoissonian()
This method tells whether the source is Poissonian, which will influence the calculation sequence in the HazardCurveCalculator


getRupturesIterator

public Iterator<ProbEqkRupture> getRupturesIterator()
Get the iterator over all ruptures This function returns the iterator for the rupturelist after calling the method getRuptureList()

Specified by:
getRupturesIterator in interface EqkSource
Returns:
the iterator object for the RuptureList

isPoissonianSource

public boolean isPoissonianSource()
Checks if the source is Poission.

Returns:
boolean

getMinDistance

public abstract double getMinDistance(Site site)
This computes some measure of the minimum distance between the source and the site passed in. This is useful for ignoring sources that are at great distanced from a site of interest. Actual implementation depend on subclass.

Parameters:
site -
Returns:
minimum distance

getNumRuptures

public abstract int getNumRuptures()
Get the number of ruptures for this source

Specified by:
getNumRuptures in interface EqkSource
Returns:
returns an integer value specifying the number of ruptures for this source

getRupture

public abstract ProbEqkRupture getRupture(int nRupture)
Get the ith rupture for this source This is a handle(or reference) to existing class variable. If this function is called again, then output from previous function call will not remain valid because of passing by reference It is a secret, fast but dangerous method

Specified by:
getRupture in interface EqkSource
Parameters:
i - ith rupture

getRuptureClone

public ProbEqkRupture getRuptureClone(int nRupture)
this function can be used if a clone is wanted instead of handle to class variable Subsequent calls to this function will not affect the result got previously. This is in contrast with the getRupture(int i) function

Specified by:
getRuptureClone in interface EqkSource
Parameters:
nRupture -
Returns:
the clone of the probEqkRupture

getRuptureList

public List<ProbEqkRupture> getRuptureList()
Returns the ArrayList consisting of all ruptures for this source all the objects are cloned. so this vector can be saved by the user

Specified by:
getRuptureList in interface EqkSource
Returns:
ArrayList consisting of the rupture clones

getName

public String getName()
get the name of this class

Specified by:
getName in interface Named
Returns:

setInfo

public void setInfo(String infoString)
Set the info for this Prob Eqk source

Parameters:
infoString - : Info

getInfo

public String getInfo()
Get the info for this source

Returns:

getSourceMetadata

public String getSourceMetadata()
Returns the Source Metadata. Source Metadata provides info. about the following : All this source info is represented as String in one line with each element seperated by a tab ("\t").

Returns:
String

computeTotalEquivMeanAnnualRate

public double computeTotalEquivMeanAnnualRate(double duration)
This computes the equivalent mean annual rate for this source (a sum of the rates of all the ruptures)

Returns:

computeTotalProb

public double computeTotalProb()
This computes the total probability for this source (a sum of the probabilities of all the ruptures)

Returns:

computeTotalProbAbove

public double computeTotalProbAbove(double mag)
This computes the total probability of all rutures great than or equal to the given mangitude

Returns:

computeApproxTotalProbAbove

public double computeApproxTotalProbAbove(double mag,
                                          Region region)
This computes the Approx total probability of all ruptures great than or equal to the given mangitude. It checks the 2 end points of the rupture to see whether the rupture lies within region If both points are within region, rupture is assumed to be in region

Returns:

computeTotalProbAbove

public double computeTotalProbAbove(double mag,
                                    Region region)
This computes the total probability of all rutures great than or equal to the given mangitude

Returns:

drawRandomEqkRuptures

public ArrayList<ProbEqkRupture> drawRandomEqkRuptures()
This draws a random list of ruptures. Non-poisson sources are not yet implemented

Returns:

drawRandomEqkRuptureIndices

public ArrayList<Integer> drawRandomEqkRuptureIndices()
This draws a random list of rupture indices. Non-poisson sources are not yet implemented

Returns:

drawSingleRandomEqkRuptureIndex

public int drawSingleRandomEqkRuptureIndex()
This draws a single rupture index based on the relative probabilities.

Returns:

getTectonicRegionType

public TectonicRegionType getTectonicRegionType()
This gets the TectonicRegionType for this source

Specified by:
getTectonicRegionType in interface EqkSource

setTectonicRegionType

public void setTectonicRegionType(TectonicRegionType tectonicRegionType)
This allows one to change the default tectonic-region type. The value must be one of those defined by the TYPE_* fields of the class org.opensha.sha.imr.param.OtherParams.TectonicRegionTypeParam.

Parameters:
tectonicRegionType -

iterator

public Iterator<ProbEqkRupture> iterator()
Specified by:
iterator in interface Iterable<ProbEqkRupture>

computeEquivTotalMomentRate

public double computeEquivTotalMomentRate(double duration)
this computes the Poisson equivalent total moment rate of the source

Parameters:
duration -
Returns:
moRate in Newton-meters/year