org.opensha.sra.gui.portfolioeal
Class Asset

java.lang.Object
  extended by org.opensha.sra.gui.portfolioeal.Asset
All Implemented Interfaces:
java.lang.Cloneable

public class Asset
extends java.lang.Object
implements java.lang.Cloneable

This class defines an asset. Each asset has a ParameterList. The parameters in the list can be arbitrary, and will be defined based on the parameters name. Each asset is responsible for calculating its own EAL as well.

Author:
Jeremy Leakakos
See Also:
PortfolioParser

Constructor Summary
Asset(java.lang.String asset)
          This constructor takes a comma separated value String
 
Method Summary
 double calculateEAL(ScalarIMR imr, double distance, ArbitrarilyDiscretizedFunc magThreshFunc, Site site, BaseERF erf, CalculationExceptionHandler controller)
           
 double calculateEAL(ScalarIMR imr, double distance, Site site, BaseERF erf, CalculationExceptionHandler controller)
          This calculates the EAL for a given asset
 double[][] calculateExpectedLossPerRup(ScalarIMR imr, ArbitrarilyDiscretizedFunc magThreshFunc, Site site, ERF erf, CalculationExceptionHandler controller)
          This calculates the expected loss for each rupture in the given forecast individually.
 Asset clone()
          The clone method for Asset.
 double getAssetEAL()
           
 int getCurrentRuptures()
           
 ArbitrarilyDiscretizedFunc getHazardFunction()
           
 Location getLocation()
           
 ParameterList getParameterList()
           
 Site getSite()
          Get the site associated with an asset.
 int getTotalRuptures()
           
 double getValue()
           
 java.lang.String getVulnModelName()
           
 boolean isCalculationDone()
           
 void setAssetParameters(java.lang.String[] assetList)
          Set the parameters for the asset.
 void siteSetup(Site site)
          Sets up the site with the name and location from the asset
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Asset

public Asset(java.lang.String asset)
This constructor takes a comma separated value String

Parameters:
asset - The csv String from the portfolio file
Method Detail

setAssetParameters

public void setAssetParameters(java.lang.String[] assetList)
Set the parameters for the asset. It takes an array of strings, which are the parameter values.

Parameters:
assetList - The list of parameters

siteSetup

public void siteSetup(Site site)
Sets up the site with the name and location from the asset

Parameters:
site - The site to have its values changed

getLocation

public Location getLocation()

getVulnModelName

public java.lang.String getVulnModelName()

calculateEAL

public double calculateEAL(ScalarIMR imr,
                           double distance,
                           Site site,
                           BaseERF erf,
                           CalculationExceptionHandler controller)
This calculates the EAL for a given asset

Returns:
The EAL for the asset. This will be summed up with all of the EAL's for the other assets in the list.

calculateEAL

public double calculateEAL(ScalarIMR imr,
                           double distance,
                           ArbitrarilyDiscretizedFunc magThreshFunc,
                           Site site,
                           BaseERF erf,
                           CalculationExceptionHandler controller)

calculateExpectedLossPerRup

public double[][] calculateExpectedLossPerRup(ScalarIMR imr,
                                              ArbitrarilyDiscretizedFunc magThreshFunc,
                                              Site site,
                                              ERF erf,
                                              CalculationExceptionHandler controller)
This calculates the expected loss for each rupture in the given forecast individually.

Returns:
The EAL for the asset. This will be summed up with all of the EAL's for the other assets in the list.

getValue

public double getValue()

isCalculationDone

public boolean isCalculationDone()
Returns:
The boolean representing whether the calculation is done or not.

getTotalRuptures

public int getTotalRuptures()
Returns:
The total amount of ruptures in a hazard calculation.

getCurrentRuptures

public int getCurrentRuptures()
Returns:
The current amount of ruptures in a hazard calculation.

getParameterList

public ParameterList getParameterList()
Returns:
The ParameterList storing the parameters for a given Asset.

getAssetEAL

public double getAssetEAL()
Returns:
The EAL for the asset

getSite

public Site getSite()
Get the site associated with an asset.

Returns:
The site for the asset

getHazardFunction

public ArbitrarilyDiscretizedFunc getHazardFunction()
Returns:
The hazard function associated with an asset

clone

public Asset clone()
            throws java.lang.CloneNotSupportedException
The clone method for Asset. It overrides the default clone operation in Object. It creates an a shallow clone of the base asset, and then it creates a clone of the base asset's ParameterList. The new asset then has its ParameterList set to the cloned one.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException