org.opensha.sra.calc
Class EALCalculator

java.lang.Object
  extended by org.opensha.sra.calc.EALCalculator

public class EALCalculator
extends java.lang.Object

This class computes the expected annualized damage factor for a given building using a hazard curve.

Author:
Eric Martinez, Keith Porter

Constructor Summary
EALCalculator()
          Default constructor.
EALCalculator(java.util.ArrayList<java.lang.Double> IML, java.util.ArrayList<java.lang.Double> DF, java.util.ArrayList<java.lang.Double> MAFE, double structValue)
          A more useful constructor.
EALCalculator(java.util.ArrayList<java.lang.Double> MAFE, DiscretizedFunc vulnFunc, double structValue)
          Creates a new EALCalculator object using the IML and DF values as defined in the given vulnFunc.
EALCalculator(DiscretizedFunc hazFunc, java.util.ArrayList<java.lang.Double> DF, double structValue)
          Creates a new EALCalculator object using the IML and MAFE values as defined in the given hazFunc.
EALCalculator(DiscretizedFunc hazFunc, DiscretizedFunc vulnFunc, double structValue)
          Creates a new EALCalculator based on the given hazFunc, vulnFunc, and structValue.
 
Method Summary
 double computeEAL()
          Computes the Expected Annualized Loss for the current values of IML, DF, and MAFE.
static double computeEAL(java.util.ArrayList<java.lang.Double> IML, java.util.ArrayList<java.lang.Double> DF, java.util.ArrayList<java.lang.Double> MAFE, double structValue)
          Same as computeEAL() except as specified below.
 java.util.ArrayList<java.lang.Double> getDF()
           
 java.util.ArrayList<java.lang.Double> getIML()
           
 java.util.ArrayList<java.lang.Double> getMAFE()
           
 double getStructValue()
           
 void setDF(java.util.ArrayList<java.lang.Double> df)
          Note: No checking is done to ensure the given DF values correspond to current IML values
 void setDF(DiscretizedFunc vulnFunc)
          Resets the values for Damage Factor to those contained in the vulnFunc.
 void setIML(java.util.ArrayList<java.lang.Double> iml)
          Note: No checking is done to ensure the given IML values correspond to current DF/MAFE values
 void setMAFE(java.util.ArrayList<java.lang.Double> pe)
          Note: No checking is done to ensure the given MAFE values correspond to current IML values
 void setMAFE(DiscretizedFunc hazFunc)
          Resets the values for Mean Annual Frequency of Exceedance to those contained in the hazFunc.
 void setStructValue(double structValue)
          Sets the replacement cost to structValue
static double testCalc()
          A simple function to test if the EALCalculator is working on the current machine/in the current application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EALCalculator

public EALCalculator()
Default constructor. IML, DF, and MAFE are set to null and must be manually set using the setVAR functions before you can compute any EAL.


EALCalculator

public EALCalculator(java.util.ArrayList<java.lang.Double> IML,
                     java.util.ArrayList<java.lang.Double> DF,
                     java.util.ArrayList<java.lang.Double> MAFE,
                     double structValue)
A more useful constructor. IML, DF, and MAFE are set as one might assume, and the calculator is ready to compute EAL.

Parameters:
IML - An ArrayList of doubles representing the Intensity Measure Values.
DF - An ArrayList of doubles representing the Damage Factor Values.
MAFE - An ArrayList of doubles representing the Mean Annual Frequency of Exceedance Values.

EALCalculator

public EALCalculator(DiscretizedFunc hazFunc,
                     java.util.ArrayList<java.lang.Double> DF,
                     double structValue)
Creates a new EALCalculator object using the IML and MAFE values as defined in the given hazFunc. Damage Factor values are set using the DF.

Parameters:
hazFunc - The Hazard Function defining (x,y) values for IML,MAFE respectively.
DF - The Damage Factor values to use in calculation.

EALCalculator

public EALCalculator(java.util.ArrayList<java.lang.Double> MAFE,
                     DiscretizedFunc vulnFunc,
                     double structValue)
Creates a new EALCalculator object using the IML and DF values as defined in the given vulnFunc. MAFE values are set using the MAFE.

Parameters:
MAFE - The Mean Annual Frequency of Exceedance values to use corresponding to the IML values defined by the vulnFunc.
vulnFunc - The Vulnerability Function defining (x,y) values for IML,DF respectively.

EALCalculator

public EALCalculator(DiscretizedFunc hazFunc,
                     DiscretizedFunc vulnFunc,
                     double structValue)
              throws java.lang.IllegalArgumentException
Creates a new EALCalculator based on the given hazFunc, vulnFunc, and structValue. The IML (x) values for the hazFunc and vulnFunc must match else an exception is thrown. A calculator created in this way will use the IML values from the haz-/vulnFunc for its IML values, the MAFE values from the hazFunc, and the DF values from the vulnFunc. The structValue is used for replacement cost.

Parameters:
hazFunc -
vulnFunc -
structValue -
Throws:
java.lang.IllegalArgumentException
Method Detail

computeEAL

public static double computeEAL(java.util.ArrayList<java.lang.Double> IML,
                                java.util.ArrayList<java.lang.Double> DF,
                                java.util.ArrayList<java.lang.Double> MAFE,
                                double structValue)
Same as computeEAL() except as specified below. But requires arguments for IML, DF, and MAFE since it is accessed statically.

Parameters:
IML - An ArrayList of doubles representing the Intensity Measure Values.
DF - An ArrayList of doubles representing the Damage Factor Values.
MAFE - An ArrayList of doubles representing the Mean Annual Frequency of Exceedance Values.
Returns:
The Expected Annualized Loss for the given parameters.

computeEAL

public double computeEAL()
Computes the Expected Annualized Loss for the current values of IML, DF, and MAFE.

Returns:
The Expected Annualized Loss for the current parameters.

getDF

public java.util.ArrayList<java.lang.Double> getDF()
Returns:
An ArrayList of Damage Factors

setDF

public void setDF(java.util.ArrayList<java.lang.Double> df)
Note: No checking is done to ensure the given DF values correspond to current IML values


getIML

public java.util.ArrayList<java.lang.Double> getIML()
Returns:
An ArrayList of IML values

setIML

public void setIML(java.util.ArrayList<java.lang.Double> iml)
Note: No checking is done to ensure the given IML values correspond to current DF/MAFE values


getMAFE

public java.util.ArrayList<java.lang.Double> getMAFE()
Returns:
An ArrayList of MAFE values

setMAFE

public void setMAFE(java.util.ArrayList<java.lang.Double> pe)
Note: No checking is done to ensure the given MAFE values correspond to current IML values


getStructValue

public double getStructValue()
Returns:
The replacement cost for the structure

setStructValue

public void setStructValue(double structValue)
Sets the replacement cost to structValue


setDF

public void setDF(DiscretizedFunc vulnFunc)
Resets the values for Damage Factor to those contained in the vulnFunc. Note that IML values remain unchanged. It is the responsibility of the caller to ensure that the current values of IML correspond to the given values for DF.

Parameters:
vulnFunc - Used to get DF values.

setMAFE

public void setMAFE(DiscretizedFunc hazFunc)
Resets the values for Mean Annual Frequency of Exceedance to those contained in the hazFunc. Note hat IML values remain unchanged. It is the responsibility of the caller to ensure that the current value of IML correspond to the given values for MAFE.

Parameters:
hazFunc - Used to get MAFE values.

testCalc

public static double testCalc()
A simple function to test if the EALCalculator is working on the current machine/in the current application. The function has predefined values for IML, DF, and MAFE, and when working properly, should return the value: 0.29209.

Returns:
The test EAL value. (0.29209)