org.opensha.sra.vulnerability.models
Class SimpleVulnerability

java.lang.Object
  extended by org.opensha.sra.vulnerability.AbstractVulnerability
      extended by org.opensha.sra.vulnerability.models.SimpleVulnerability
All Implemented Interfaces:
Serializable, Vulnerability

public class SimpleVulnerability
extends AbstractVulnerability
implements Serializable

This is a simple, perhaps temporary class for instantiating AbstractVulerability objects from files.

Author:
kevin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opensha.sra.vulnerability.AbstractVulnerability
ADF, BDF, im_type, name, PGA, SA, shortName
 
Constructor Summary
SimpleVulnerability(String name, String shortName, String im_type, ArrayList<Double> im_levels, ArrayList<Double> mdfVals, ArrayList<Double> covVals)
           
 
Method Summary
 AbstractDiscretizedFunc getCOVFunction()
           
 double[] getDEMDFVals()
          Gets or computes the DF values that correspond the the Damage Exceedance Matrix.
 double[][] getDEMMatrix()
          Gets or creates the Damage Exceedance Matrix associated with the current vulnerability model.
 double getDF(double IML)
          Interpolates the MDF values found in the DFTable for the given IML.
 ArrayList<double[]> getDFTable()
          The DF Lookup Table has dimension NIML x 3 and holds the IML, MDF, and COV values associated with the current Vulnerability Model.
 double getMeanDamageAtExceedProb(double iml, double prob)
          Returns the mean damage with probability P of being exceeded given P and an IML (in linear space).
 double getMeanDamageFactor(double iml)
          Returns the mean damage factor at the given IML in linear space.
 AbstractDiscretizedFunc getVulnerabilityFunc()
          original javadoc: TODO clean Gets the IML values and DF values and maps them into the X,Y values (respectively) of a new DiscretizedFunc.
 String toString()
           
 
Methods inherited from class org.opensha.sra.vulnerability.AbstractVulnerability
getADF, getAssetType, getBDF, getDFVals, getExceedProb, getHazardTemplate, getIMLValues, getIMT, getLossStdDev, getLossType, getMaxIMLVal, getMinIMLVal, getName, getParameters, getPeriod, getShortName, setParameter, setPeriod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleVulnerability

public SimpleVulnerability(String name,
                           String shortName,
                           String im_type,
                           ArrayList<Double> im_levels,
                           ArrayList<Double> mdfVals,
                           ArrayList<Double> covVals)
Method Detail

getDEMDFVals

public double[] getDEMDFVals()
Description copied from class: AbstractVulnerability
Gets or computes the DF values that correspond the the Damage Exceedance Matrix. This may or may not be the same as the regular MDF values depending on implementation.

Specified by:
getDEMDFVals in class AbstractVulnerability
Returns:
The Damage Factor values associated with the DEM.

getDEMMatrix

public double[][] getDEMMatrix()
Description copied from class: AbstractVulnerability
Gets or creates the Damage Exceedance Matrix associated with the current vulnerability model. This can either be precomputed and stored in memory (faster runtime, larger memory requirements), or it can be computed on the fly with an (assumed/given) distribution by using the MDF and COVDF.

Specified by:
getDEMMatrix in class AbstractVulnerability
Returns:
The Damage Exceedance Matrix

getDF

public double getDF(double IML)
Description copied from class: AbstractVulnerability
Interpolates the MDF values found in the DFTable for the given IML.

Specified by:
getDF in class AbstractVulnerability
Parameters:
IML - The desired Intensity Measure Level.
Returns:
The mean Damage Factor for the given IML.

getDFTable

public ArrayList<double[]> getDFTable()
Description copied from class: AbstractVulnerability
The DF Lookup Table has dimension NIML x 3 and holds the IML, MDF, and COV values associated with the current Vulnerability Model. The structure of this table is as follows:
                        \________________________________________________
                IML  |  IML1    IML2    IML3    ....    IML(NIML)
                MDF  |  MDF1    MDF2    MDF3    ....    MDF(NIML)
                COV  |  COV1    COV2    COV3    ....    COV(NIML
 

Specified by:
getDFTable in class AbstractVulnerability
Returns:
The DF lookup table used with the current Vulnerability Model.

getVulnerabilityFunc

public AbstractDiscretizedFunc getVulnerabilityFunc()
Description copied from class: AbstractVulnerability
original javadoc: TODO clean Gets the IML values and DF values and maps them into the X,Y values (respectively) of a new DiscretizedFunc.

Specified by:
getVulnerabilityFunc in interface Vulnerability
Overrides:
getVulnerabilityFunc in class AbstractVulnerability
Returns:
A DiscretizedFunc with X,Y values corresponding to the IML,DF values respectively. The function will have NIML points.

toString

public String toString()
Overrides:
toString in class Object

getMeanDamageAtExceedProb

public double getMeanDamageAtExceedProb(double iml,
                                        double prob)
Description copied from interface: Vulnerability
Returns the mean damage with probability P of being exceeded given P and an IML (in linear space). Non-negative real (double).

Specified by:
getMeanDamageAtExceedProb in interface Vulnerability
Overrides:
getMeanDamageAtExceedProb in class AbstractVulnerability
Returns:
the loss for a given probability and IML

getCOVFunction

public AbstractDiscretizedFunc getCOVFunction()

getMeanDamageFactor

public double getMeanDamageFactor(double iml)
Description copied from interface: Vulnerability
Returns the mean damage factor at the given IML in linear space. Non-negative real (double).

Specified by:
getMeanDamageFactor in interface Vulnerability
Overrides:
getMeanDamageFactor in class AbstractVulnerability
Returns:
the mean loss for a given IML