org.opensha.sha.imr.param.PropagationEffectParams
Class DistanceSeisParameter

java.lang.Object
  extended by org.opensha.commons.param.AbstractParameter<E>
      extended by org.opensha.sha.imr.param.PropagationEffectParams.PropagationEffectParameter<java.lang.Double>
          extended by org.opensha.sha.imr.param.PropagationEffectParams.AbstractDoublePropEffectParam
              extended by org.opensha.sha.imr.param.PropagationEffectParams.DistanceSeisParameter
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Parameter<?>>, Named, XMLSaveable, Parameter<java.lang.Double>, WarningParameter<java.lang.Double>, PropagationEffectParameterAPI<java.lang.Double>

public class DistanceSeisParameter
extends AbstractDoublePropEffectParam

Title: DistanceSeisParameter

Description: Special subclass of PropagationEffectParameter. This computes the closest distance to the seimogenic part of the fault; that is, the closest distance to the part of the fault that is below the seimogenic thickness (seisDepth); this depth is currently hardwired at 3 km, but we can add setSeisDepth() and getSeisDepth() methods if desired (the setter will have to create a new constraint with seisDepth as the lower bound, which can be done even if the parameter has been set as non editable). Note that if the earthquake rupture is a line or point source where the depths are less than seisDepth, then the depths are treated as seisDepth (e.g., for grid based forecast where all sources are put at zero depth)

Version:
1.0
Author:
Steven W. Rock
See Also:
DistanceRupParameter, DistanceJBParameter, Serialized Form

Field Summary
protected static java.lang.String C
          Class name used in debug strings
protected static boolean D
          If true debug statements are printed out
static java.lang.String NAME
          Hardcoded name
static double SEIS_DEPTH
          set default seismogenic depth.
 
Fields inherited from class org.opensha.sha.imr.param.PropagationEffectParams.AbstractDoublePropEffectParam
ignoreWarning, warningConstraint, warningListeners
 
Fields inherited from class org.opensha.sha.imr.param.PropagationEffectParams.PropagationEffectParameter
eqkRupture, site
 
Fields inherited from class org.opensha.commons.param.AbstractParameter
constraint, defaultValue, editable, independentParameters, info, metadataString, name, units, value, XML_COMPLEX_VAL_EL_NAME, XML_GROUP_METADATA_NAME, XML_METADATA_NAME, XML_NULL_VALUE
 
Fields inherited from interface org.opensha.commons.param.Parameter
XML_INDEPENDENT_PARAMS_NAME
 
Fields inherited from interface org.opensha.commons.metadata.XMLSaveable
XML_METADATA_NAME
 
Constructor Summary
DistanceSeisParameter()
          No-Arg constructor that just calls init() with null constraints.
DistanceSeisParameter(double defaultValue)
          This constructor sets the default value.
DistanceSeisParameter(ParameterConstraint warningConstraint)
          Constructor that sets up constraints.
DistanceSeisParameter(ParameterConstraint warningConstraint, double defaultValue)
          Constructor that sets up constraints & the default value.
 
Method Summary
protected  void calcValueFromSiteAndEqkRup()
          Note that this does not throw a warning
 java.lang.Object clone()
          Returns a copy so you can't edit or damage the origial.
 java.lang.String getType()
          This is used to determine what widget editor to use in GUI Applets.
protected  void init()
          Initializes the constraints, name, etc.
protected  void init(DoubleConstraint warningConstraint)
          Initializes the constraints, name, etc.
 boolean setIndividualParamValueFromXML(Element el)
          This should set the value of this individual parameter.
 
Methods inherited from class org.opensha.sha.imr.param.PropagationEffectParams.AbstractDoublePropEffectParam
addParameterChangeWarningListener, compareTo, equals, fireParameterChangeWarning, getEditor, getWarningConstraint, getWarningMax, getWarningMin, isIgnoreWarning, isRecommended, removeParameterChangeWarningListener, setIgnoreWarning, setValue, setValueIgnoreWarning, setWarningConstraint
 
Methods inherited from class org.opensha.sha.imr.param.PropagationEffectParams.PropagationEffectParameter
getValue, setValue
 
Methods inherited from class org.opensha.commons.param.AbstractParameter
addIndependentParameter, addParameterChangeFailListener, addParameterChangeListener, checkEditable, containsIndependentParameter, firePropertyChange, firePropertyChangeFailed, getConstraint, getConstraintName, getDefaultValue, getDependentParamMetadataString, getIndependentParameter, getIndependentParameterList, getIndependentParametersKey, getInfo, getMetadataString, getName, getNumIndependentParameters, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, setConstraint, setDefaultValue, setDependentParamMetadataString, setIndependentParameters, setIndepParamsFromXML, setInfo, setName, setNonEditable, setUnits, setValueAsDefault, setValueFromXMLMetadata, toXMLMetadata, toXMLMetadata, unableToSetValue, valueToXML
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensha.commons.param.Parameter
addIndependentParameter, addParameterChangeFailListener, addParameterChangeListener, containsIndependentParameter, firePropertyChange, firePropertyChangeFailed, getConstraint, getConstraintName, getDefaultValue, getDependentParamMetadataString, getIndependentParameter, getIndependentParameterList, getIndependentParametersKey, getInfo, getMetadataString, getNumIndependentParameters, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, setConstraint, setDefaultValue, setIndependentParameters, setInfo, setName, setNonEditable, setUnits, setValueAsDefault, setValueFromXMLMetadata, toXMLMetadata, unableToSetValue
 
Methods inherited from interface org.opensha.commons.data.Named
getName
 
Methods inherited from interface org.opensha.commons.metadata.XMLSaveable
toXMLMetadata
 

Field Detail

C

protected static final java.lang.String C
Class name used in debug strings

See Also:
Constant Field Values

D

protected static final boolean D
If true debug statements are printed out

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
Hardcoded name

See Also:
Constant Field Values

SEIS_DEPTH

public static final double SEIS_DEPTH
set default seismogenic depth. actually hard-wired for now.

See Also:
Constant Field Values
Constructor Detail

DistanceSeisParameter

public DistanceSeisParameter()
No-Arg constructor that just calls init() with null constraints. All value are allowed.


DistanceSeisParameter

public DistanceSeisParameter(double defaultValue)
This constructor sets the default value.


DistanceSeisParameter

public DistanceSeisParameter(ParameterConstraint warningConstraint)
                      throws ConstraintException
Constructor that sets up constraints. This is a constrained parameter.

Throws:
ConstraintException

DistanceSeisParameter

public DistanceSeisParameter(ParameterConstraint warningConstraint,
                             double defaultValue)
                      throws ConstraintException
Constructor that sets up constraints & the default value. This is a constrained parameter.

Throws:
ConstraintException
Method Detail

init

protected void init(DoubleConstraint warningConstraint)
Initializes the constraints, name, etc. for this parameter


init

protected void init()
Initializes the constraints, name, etc. for this parameter


calcValueFromSiteAndEqkRup

protected void calcValueFromSiteAndEqkRup()
Note that this does not throw a warning

Specified by:
calcValueFromSiteAndEqkRup in class PropagationEffectParameter<java.lang.Double>

getType

public java.lang.String getType()
This is used to determine what widget editor to use in GUI Applets.

Specified by:
getType in interface Parameter<java.lang.Double>
Overrides:
getType in class PropagationEffectParameter<java.lang.Double>

clone

public java.lang.Object clone()
Returns a copy so you can't edit or damage the origial.

Note: this is not a true clone. I did not clone Site or ProbEqkRupture. PE could potentially have a million points, way to expensive to clone. Should not be a problem though because once the PE and Site are set, they can not be modified by this class. The clone has null Site and PE parameters.

This will probably have to be changed in the future once the use of a clone is needed and we see the best way to implement this.

Specified by:
clone in interface Parameter<java.lang.Double>
Specified by:
clone in class AbstractParameter<java.lang.Double>
Returns:
Exact copy of this object's state

setIndividualParamValueFromXML

public boolean setIndividualParamValueFromXML(Element el)
Description copied from class: AbstractParameter
This should set the value of this individual parameter. The values of the independent parameters will be set by the final setValueFromXMLMetadata method

Specified by:
setIndividualParamValueFromXML in class AbstractParameter<java.lang.Double>
Returns: